proteus  1.8.0
C/C++/Fortran libraries
BoundaryConditions.cpp
Go to the documentation of this file.
1 /* Generated by Cython 0.29.24 */
2 
3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
5 #endif /* PY_SSIZE_T_CLEAN */
6 #include "Python.h"
7 #ifndef Py_PYTHON_H
8  #error Python headers needed to compile C extensions, please install development version of Python.
9 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10  #error Cython requires Python 2.6+ or Python 3.3+.
11 #else
12 #define CYTHON_ABI "0_29_24"
13 #define CYTHON_HEX_VERSION 0x001D18F0
14 #define CYTHON_FUTURE_DIVISION 0
15 #include <stddef.h>
16 #ifndef offsetof
17  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
18 #endif
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
20  #ifndef __stdcall
21  #define __stdcall
22  #endif
23  #ifndef __cdecl
24  #define __cdecl
25  #endif
26  #ifndef __fastcall
27  #define __fastcall
28  #endif
29 #endif
30 #ifndef DL_IMPORT
31  #define DL_IMPORT(t) t
32 #endif
33 #ifndef DL_EXPORT
34  #define DL_EXPORT(t) t
35 #endif
36 #define __PYX_COMMA ,
37 #ifndef HAVE_LONG_LONG
38  #if PY_VERSION_HEX >= 0x02070000
39  #define HAVE_LONG_LONG
40  #endif
41 #endif
42 #ifndef PY_LONG_LONG
43  #define PY_LONG_LONG LONG_LONG
44 #endif
45 #ifndef Py_HUGE_VAL
46  #define Py_HUGE_VAL HUGE_VAL
47 #endif
48 #ifdef PYPY_VERSION
49  #define CYTHON_COMPILING_IN_PYPY 1
50  #define CYTHON_COMPILING_IN_PYSTON 0
51  #define CYTHON_COMPILING_IN_CPYTHON 0
52  #undef CYTHON_USE_TYPE_SLOTS
53  #define CYTHON_USE_TYPE_SLOTS 0
54  #undef CYTHON_USE_PYTYPE_LOOKUP
55  #define CYTHON_USE_PYTYPE_LOOKUP 0
56  #if PY_VERSION_HEX < 0x03050000
57  #undef CYTHON_USE_ASYNC_SLOTS
58  #define CYTHON_USE_ASYNC_SLOTS 0
59  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
60  #define CYTHON_USE_ASYNC_SLOTS 1
61  #endif
62  #undef CYTHON_USE_PYLIST_INTERNALS
63  #define CYTHON_USE_PYLIST_INTERNALS 0
64  #undef CYTHON_USE_UNICODE_INTERNALS
65  #define CYTHON_USE_UNICODE_INTERNALS 0
66  #undef CYTHON_USE_UNICODE_WRITER
67  #define CYTHON_USE_UNICODE_WRITER 0
68  #undef CYTHON_USE_PYLONG_INTERNALS
69  #define CYTHON_USE_PYLONG_INTERNALS 0
70  #undef CYTHON_AVOID_BORROWED_REFS
71  #define CYTHON_AVOID_BORROWED_REFS 1
72  #undef CYTHON_ASSUME_SAFE_MACROS
73  #define CYTHON_ASSUME_SAFE_MACROS 0
74  #undef CYTHON_UNPACK_METHODS
75  #define CYTHON_UNPACK_METHODS 0
76  #undef CYTHON_FAST_THREAD_STATE
77  #define CYTHON_FAST_THREAD_STATE 0
78  #undef CYTHON_FAST_PYCALL
79  #define CYTHON_FAST_PYCALL 0
80  #undef CYTHON_PEP489_MULTI_PHASE_INIT
81  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
82  #undef CYTHON_USE_TP_FINALIZE
83  #define CYTHON_USE_TP_FINALIZE 0
84  #undef CYTHON_USE_DICT_VERSIONS
85  #define CYTHON_USE_DICT_VERSIONS 0
86  #undef CYTHON_USE_EXC_INFO_STACK
87  #define CYTHON_USE_EXC_INFO_STACK 0
88 #elif defined(PYSTON_VERSION)
89  #define CYTHON_COMPILING_IN_PYPY 0
90  #define CYTHON_COMPILING_IN_PYSTON 1
91  #define CYTHON_COMPILING_IN_CPYTHON 0
92  #ifndef CYTHON_USE_TYPE_SLOTS
93  #define CYTHON_USE_TYPE_SLOTS 1
94  #endif
95  #undef CYTHON_USE_PYTYPE_LOOKUP
96  #define CYTHON_USE_PYTYPE_LOOKUP 0
97  #undef CYTHON_USE_ASYNC_SLOTS
98  #define CYTHON_USE_ASYNC_SLOTS 0
99  #undef CYTHON_USE_PYLIST_INTERNALS
100  #define CYTHON_USE_PYLIST_INTERNALS 0
101  #ifndef CYTHON_USE_UNICODE_INTERNALS
102  #define CYTHON_USE_UNICODE_INTERNALS 1
103  #endif
104  #undef CYTHON_USE_UNICODE_WRITER
105  #define CYTHON_USE_UNICODE_WRITER 0
106  #undef CYTHON_USE_PYLONG_INTERNALS
107  #define CYTHON_USE_PYLONG_INTERNALS 0
108  #ifndef CYTHON_AVOID_BORROWED_REFS
109  #define CYTHON_AVOID_BORROWED_REFS 0
110  #endif
111  #ifndef CYTHON_ASSUME_SAFE_MACROS
112  #define CYTHON_ASSUME_SAFE_MACROS 1
113  #endif
114  #ifndef CYTHON_UNPACK_METHODS
115  #define CYTHON_UNPACK_METHODS 1
116  #endif
117  #undef CYTHON_FAST_THREAD_STATE
118  #define CYTHON_FAST_THREAD_STATE 0
119  #undef CYTHON_FAST_PYCALL
120  #define CYTHON_FAST_PYCALL 0
121  #undef CYTHON_PEP489_MULTI_PHASE_INIT
122  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
123  #undef CYTHON_USE_TP_FINALIZE
124  #define CYTHON_USE_TP_FINALIZE 0
125  #undef CYTHON_USE_DICT_VERSIONS
126  #define CYTHON_USE_DICT_VERSIONS 0
127  #undef CYTHON_USE_EXC_INFO_STACK
128  #define CYTHON_USE_EXC_INFO_STACK 0
129 #else
130  #define CYTHON_COMPILING_IN_PYPY 0
131  #define CYTHON_COMPILING_IN_PYSTON 0
132  #define CYTHON_COMPILING_IN_CPYTHON 1
133  #ifndef CYTHON_USE_TYPE_SLOTS
134  #define CYTHON_USE_TYPE_SLOTS 1
135  #endif
136  #if PY_VERSION_HEX < 0x02070000
137  #undef CYTHON_USE_PYTYPE_LOOKUP
138  #define CYTHON_USE_PYTYPE_LOOKUP 0
139  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
140  #define CYTHON_USE_PYTYPE_LOOKUP 1
141  #endif
142  #if PY_MAJOR_VERSION < 3
143  #undef CYTHON_USE_ASYNC_SLOTS
144  #define CYTHON_USE_ASYNC_SLOTS 0
145  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
146  #define CYTHON_USE_ASYNC_SLOTS 1
147  #endif
148  #if PY_VERSION_HEX < 0x02070000
149  #undef CYTHON_USE_PYLONG_INTERNALS
150  #define CYTHON_USE_PYLONG_INTERNALS 0
151  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
152  #define CYTHON_USE_PYLONG_INTERNALS 1
153  #endif
154  #ifndef CYTHON_USE_PYLIST_INTERNALS
155  #define CYTHON_USE_PYLIST_INTERNALS 1
156  #endif
157  #ifndef CYTHON_USE_UNICODE_INTERNALS
158  #define CYTHON_USE_UNICODE_INTERNALS 1
159  #endif
160  #if PY_VERSION_HEX < 0x030300F0
161  #undef CYTHON_USE_UNICODE_WRITER
162  #define CYTHON_USE_UNICODE_WRITER 0
163  #elif !defined(CYTHON_USE_UNICODE_WRITER)
164  #define CYTHON_USE_UNICODE_WRITER 1
165  #endif
166  #ifndef CYTHON_AVOID_BORROWED_REFS
167  #define CYTHON_AVOID_BORROWED_REFS 0
168  #endif
169  #ifndef CYTHON_ASSUME_SAFE_MACROS
170  #define CYTHON_ASSUME_SAFE_MACROS 1
171  #endif
172  #ifndef CYTHON_UNPACK_METHODS
173  #define CYTHON_UNPACK_METHODS 1
174  #endif
175  #ifndef CYTHON_FAST_THREAD_STATE
176  #define CYTHON_FAST_THREAD_STATE 1
177  #endif
178  #ifndef CYTHON_FAST_PYCALL
179  #define CYTHON_FAST_PYCALL 1
180  #endif
181  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
182  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
183  #endif
184  #ifndef CYTHON_USE_TP_FINALIZE
185  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
186  #endif
187  #ifndef CYTHON_USE_DICT_VERSIONS
188  #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
189  #endif
190  #ifndef CYTHON_USE_EXC_INFO_STACK
191  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
192  #endif
193 #endif
194 #if !defined(CYTHON_FAST_PYCCALL)
195 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
196 #endif
197 #if CYTHON_USE_PYLONG_INTERNALS
198  #include "longintrepr.h"
199  #undef SHIFT
200  #undef BASE
201  #undef MASK
202  #ifdef SIZEOF_VOID_P
203  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
204  #endif
205 #endif
206 #ifndef __has_attribute
207  #define __has_attribute(x) 0
208 #endif
209 #ifndef __has_cpp_attribute
210  #define __has_cpp_attribute(x) 0
211 #endif
212 #ifndef CYTHON_RESTRICT
213  #if defined(__GNUC__)
214  #define CYTHON_RESTRICT __restrict__
215  #elif defined(_MSC_VER) && _MSC_VER >= 1400
216  #define CYTHON_RESTRICT __restrict
217  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
218  #define CYTHON_RESTRICT restrict
219  #else
220  #define CYTHON_RESTRICT
221  #endif
222 #endif
223 #ifndef CYTHON_UNUSED
224 # if defined(__GNUC__)
225 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
226 # define CYTHON_UNUSED __attribute__ ((__unused__))
227 # else
228 # define CYTHON_UNUSED
229 # endif
230 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
231 # define CYTHON_UNUSED __attribute__ ((__unused__))
232 # else
233 # define CYTHON_UNUSED
234 # endif
235 #endif
236 #ifndef CYTHON_MAYBE_UNUSED_VAR
237 # if defined(__cplusplus)
238  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
239 # else
240 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
241 # endif
242 #endif
243 #ifndef CYTHON_NCP_UNUSED
244 # if CYTHON_COMPILING_IN_CPYTHON
245 # define CYTHON_NCP_UNUSED
246 # else
247 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
248 # endif
249 #endif
250 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
251 #ifdef _MSC_VER
252  #ifndef _MSC_STDINT_H_
253  #if _MSC_VER < 1300
254  typedef unsigned char uint8_t;
255  typedef unsigned int uint32_t;
256  #else
257  typedef unsigned __int8 uint8_t;
258  typedef unsigned __int32 uint32_t;
259  #endif
260  #endif
261 #else
262  #include <stdint.h>
263 #endif
264 #ifndef CYTHON_FALLTHROUGH
265  #if defined(__cplusplus) && __cplusplus >= 201103L
266  #if __has_cpp_attribute(fallthrough)
267  #define CYTHON_FALLTHROUGH [[fallthrough]]
268  #elif __has_cpp_attribute(clang::fallthrough)
269  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
270  #elif __has_cpp_attribute(gnu::fallthrough)
271  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
272  #endif
273  #endif
274  #ifndef CYTHON_FALLTHROUGH
275  #if __has_attribute(fallthrough)
276  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
277  #else
278  #define CYTHON_FALLTHROUGH
279  #endif
280  #endif
281  #if defined(__clang__ ) && defined(__apple_build_version__)
282  #if __apple_build_version__ < 7000000
283  #undef CYTHON_FALLTHROUGH
284  #define CYTHON_FALLTHROUGH
285  #endif
286  #endif
287 #endif
288 
289 #ifndef __cplusplus
290  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
291 #endif
292 #ifndef CYTHON_INLINE
293  #if defined(__clang__)
294  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
295  #else
296  #define CYTHON_INLINE inline
297  #endif
298 #endif
299 template<typename T>
300 void __Pyx_call_destructor(T& x) {
301  x.~T();
302 }
303 template<typename T>
304 class __Pyx_FakeReference {
305  public:
306  __Pyx_FakeReference() : ptr(NULL) { }
307  __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
308  T *operator->() { return ptr; }
309  T *operator&() { return ptr; }
310  operator T&() { return *ptr; }
311  template<typename U> bool operator ==(U other) { return *ptr == other; }
312  template<typename U> bool operator !=(U other) { return *ptr != other; }
313  private:
314  T *ptr;
315 };
316 
317 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
318  #define Py_OptimizeFlag 0
319 #endif
320 #define __PYX_BUILD_PY_SSIZE_T "n"
321 #define CYTHON_FORMAT_SSIZE_T "z"
322 #if PY_MAJOR_VERSION < 3
323  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
324  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
325  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
326  #define __Pyx_DefaultClassType PyClass_Type
327 #else
328  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
329 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
330  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
331  PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
332 #else
333  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
334  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
335 #endif
336  #define __Pyx_DefaultClassType PyType_Type
337 #endif
338 #ifndef Py_TPFLAGS_CHECKTYPES
339  #define Py_TPFLAGS_CHECKTYPES 0
340 #endif
341 #ifndef Py_TPFLAGS_HAVE_INDEX
342  #define Py_TPFLAGS_HAVE_INDEX 0
343 #endif
344 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
345  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
346 #endif
347 #ifndef Py_TPFLAGS_HAVE_FINALIZE
348  #define Py_TPFLAGS_HAVE_FINALIZE 0
349 #endif
350 #ifndef METH_STACKLESS
351  #define METH_STACKLESS 0
352 #endif
353 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
354  #ifndef METH_FASTCALL
355  #define METH_FASTCALL 0x80
356  #endif
357  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
358  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
359  Py_ssize_t nargs, PyObject *kwnames);
360 #else
361  #define __Pyx_PyCFunctionFast _PyCFunctionFast
362  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
363 #endif
364 #if CYTHON_FAST_PYCCALL
365 #define __Pyx_PyFastCFunction_Check(func)\
366  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
367 #else
368 #define __Pyx_PyFastCFunction_Check(func) 0
369 #endif
370 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
371  #define PyObject_Malloc(s) PyMem_Malloc(s)
372  #define PyObject_Free(p) PyMem_Free(p)
373  #define PyObject_Realloc(p) PyMem_Realloc(p)
374 #endif
375 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
376  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
377  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
378  #define PyMem_RawFree(p) PyMem_Free(p)
379 #endif
380 #if CYTHON_COMPILING_IN_PYSTON
381  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
382  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
383 #else
384  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
385  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
386 #endif
387 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
388  #define __Pyx_PyThreadState_Current PyThreadState_GET()
389 #elif PY_VERSION_HEX >= 0x03060000
390  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
391 #elif PY_VERSION_HEX >= 0x03000000
392  #define __Pyx_PyThreadState_Current PyThreadState_GET()
393 #else
394  #define __Pyx_PyThreadState_Current _PyThreadState_Current
395 #endif
396 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
397 #include "pythread.h"
398 #define Py_tss_NEEDS_INIT 0
399 typedef int Py_tss_t;
400 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
401  *key = PyThread_create_key();
402  return 0;
403 }
404 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
405  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
406  *key = Py_tss_NEEDS_INIT;
407  return key;
408 }
409 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
410  PyObject_Free(key);
411 }
412 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
413  return *key != Py_tss_NEEDS_INIT;
414 }
415 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
416  PyThread_delete_key(*key);
417  *key = Py_tss_NEEDS_INIT;
418 }
419 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
420  return PyThread_set_key_value(*key, value);
421 }
422 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
423  return PyThread_get_key_value(*key);
424 }
425 #endif
426 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
427 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
428 #else
429 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
430 #endif
431 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
432  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
433  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
434 #else
435  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
436  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
437 #endif
438 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
439 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
440 #else
441 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
442 #endif
443 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
444  #define CYTHON_PEP393_ENABLED 1
445  #if defined(PyUnicode_IS_READY)
446  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
447  0 : _PyUnicode_Ready((PyObject *)(op)))
448  #else
449  #define __Pyx_PyUnicode_READY(op) (0)
450  #endif
451  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
452  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
453  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
454  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
455  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
456  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
457  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
458  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
459  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
460  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
461  #else
462  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
463  #endif
464  #else
465  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
466  #endif
467 #else
468  #define CYTHON_PEP393_ENABLED 0
469  #define PyUnicode_1BYTE_KIND 1
470  #define PyUnicode_2BYTE_KIND 2
471  #define PyUnicode_4BYTE_KIND 4
472  #define __Pyx_PyUnicode_READY(op) (0)
473  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
474  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
475  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
476  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
477  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
478  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
479  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
480  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
481 #endif
482 #if CYTHON_COMPILING_IN_PYPY
483  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
484  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
485 #else
486  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
487  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
488  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
489 #endif
490 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
491  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
492 #endif
493 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
494  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
495 #endif
496 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
497  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
498 #endif
499 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
500 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
501 #if PY_MAJOR_VERSION >= 3
502  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
503 #else
504  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
505 #endif
506 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
507  #define PyObject_ASCII(o) PyObject_Repr(o)
508 #endif
509 #if PY_MAJOR_VERSION >= 3
510  #define PyBaseString_Type PyUnicode_Type
511  #define PyStringObject PyUnicodeObject
512  #define PyString_Type PyUnicode_Type
513  #define PyString_Check PyUnicode_Check
514  #define PyString_CheckExact PyUnicode_CheckExact
515 #ifndef PyObject_Unicode
516  #define PyObject_Unicode PyObject_Str
517 #endif
518 #endif
519 #if PY_MAJOR_VERSION >= 3
520  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
521  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
522 #else
523  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
524  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
525 #endif
526 #ifndef PySet_CheckExact
527  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
528 #endif
529 #if PY_VERSION_HEX >= 0x030900A4
530  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
531  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
532 #else
533  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
534  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
535 #endif
536 #if CYTHON_ASSUME_SAFE_MACROS
537  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
538 #else
539  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
540 #endif
541 #if PY_MAJOR_VERSION >= 3
542  #define PyIntObject PyLongObject
543  #define PyInt_Type PyLong_Type
544  #define PyInt_Check(op) PyLong_Check(op)
545  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
546  #define PyInt_FromString PyLong_FromString
547  #define PyInt_FromUnicode PyLong_FromUnicode
548  #define PyInt_FromLong PyLong_FromLong
549  #define PyInt_FromSize_t PyLong_FromSize_t
550  #define PyInt_FromSsize_t PyLong_FromSsize_t
551  #define PyInt_AsLong PyLong_AsLong
552  #define PyInt_AS_LONG PyLong_AS_LONG
553  #define PyInt_AsSsize_t PyLong_AsSsize_t
554  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
555  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
556  #define PyNumber_Int PyNumber_Long
557 #endif
558 #if PY_MAJOR_VERSION >= 3
559  #define PyBoolObject PyLongObject
560 #endif
561 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
562  #ifndef PyUnicode_InternFromString
563  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
564  #endif
565 #endif
566 #if PY_VERSION_HEX < 0x030200A4
567  typedef long Py_hash_t;
568  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
569  #define __Pyx_PyInt_AsHash_t PyInt_AsLong
570 #else
571  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
572  #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
573 #endif
574 #if PY_MAJOR_VERSION >= 3
575  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
576 #else
577  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
578 #endif
579 #if CYTHON_USE_ASYNC_SLOTS
580  #if PY_VERSION_HEX >= 0x030500B1
581  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
582  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
583  #else
584  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
585  #endif
586 #else
587  #define __Pyx_PyType_AsAsync(obj) NULL
588 #endif
589 #ifndef __Pyx_PyAsyncMethodsStruct
590  typedef struct {
591  unaryfunc am_await;
592  unaryfunc am_aiter;
593  unaryfunc am_anext;
594  } __Pyx_PyAsyncMethodsStruct;
595 #endif
596 
597 #if defined(WIN32) || defined(MS_WINDOWS)
598  #define _USE_MATH_DEFINES
599 #endif
600 #include <math.h>
601 #ifdef NAN
602 #define __PYX_NAN() ((float) NAN)
603 #else
604 static CYTHON_INLINE float __PYX_NAN() {
605  float value;
606  memset(&value, 0xFF, sizeof(value));
607  return value;
608 }
609 #endif
610 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
611 #define __Pyx_truncl trunc
612 #else
613 #define __Pyx_truncl truncl
614 #endif
615 
616 #define __PYX_MARK_ERR_POS(f_index, lineno) \
617  { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
618 #define __PYX_ERR(f_index, lineno, Ln_error) \
619  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
620 
621 #ifndef __PYX_EXTERN_C
622  #ifdef __cplusplus
623  #define __PYX_EXTERN_C extern "C"
624  #else
625  #define __PYX_EXTERN_C extern
626  #endif
627 #endif
628 
629 #define __PYX_HAVE__BoundaryConditions
630 #define __PYX_HAVE_API__BoundaryConditions
631 /* Early includes */
632 #include <string.h>
633 #include <stdio.h>
634 #include "numpy/arrayobject.h"
635 #include "numpy/ndarrayobject.h"
636 #include "numpy/ndarraytypes.h"
637 #include "numpy/arrayscalars.h"
638 #include "numpy/ufuncobject.h"
639 
640  /* NumPy API declarations from "numpy/__init__.pxd" */
641 
642 #include "pythread.h"
643 #include <stdlib.h>
644 #include "pystate.h"
645 #ifdef _OPENMP
646 #include <omp.h>
647 #endif /* _OPENMP */
648 
649 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
650 #define CYTHON_WITHOUT_ASSERTIONS
651 #endif
652 
653 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
654  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
655 
656 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
657 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
658 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
659 #define __PYX_DEFAULT_STRING_ENCODING ""
660 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
661 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
662 #define __Pyx_uchar_cast(c) ((unsigned char)c)
663 #define __Pyx_long_cast(x) ((long)x)
664 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
665  (sizeof(type) < sizeof(Py_ssize_t)) ||\
666  (sizeof(type) > sizeof(Py_ssize_t) &&\
667  likely(v < (type)PY_SSIZE_T_MAX ||\
668  v == (type)PY_SSIZE_T_MAX) &&\
669  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
670  v == (type)PY_SSIZE_T_MIN))) ||\
671  (sizeof(type) == sizeof(Py_ssize_t) &&\
672  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
673  v == (type)PY_SSIZE_T_MAX))) )
674 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
675  return (size_t) i < (size_t) limit;
676 }
677 #if defined (__cplusplus) && __cplusplus >= 201103L
678  #include <cstdlib>
679  #define __Pyx_sst_abs(value) std::abs(value)
680 #elif SIZEOF_INT >= SIZEOF_SIZE_T
681  #define __Pyx_sst_abs(value) abs(value)
682 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
683  #define __Pyx_sst_abs(value) labs(value)
684 #elif defined (_MSC_VER)
685  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
686 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
687  #define __Pyx_sst_abs(value) llabs(value)
688 #elif defined (__GNUC__)
689  #define __Pyx_sst_abs(value) __builtin_llabs(value)
690 #else
691  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
692 #endif
693 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
694 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
695 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
696 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
697 #define __Pyx_PyBytes_FromString PyBytes_FromString
698 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
699 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
700 #if PY_MAJOR_VERSION < 3
701  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
702  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
703 #else
704  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
705  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
706 #endif
707 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
708 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
709 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
710 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
711 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
712 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
713 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
714 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
715 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
716 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
717 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
718 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
719 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
720 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
721 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
722 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
723 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
724  const Py_UNICODE *u_end = u;
725  while (*u_end++) ;
726  return (size_t)(u_end - u - 1);
727 }
728 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
729 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
730 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
731 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
732 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
733 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
734 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
735 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
736 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
737 #define __Pyx_PySequence_Tuple(obj)\
738  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
739 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
740 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
741 #if CYTHON_ASSUME_SAFE_MACROS
742 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
743 #else
744 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
745 #endif
746 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
747 #if PY_MAJOR_VERSION >= 3
748 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
749 #else
750 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
751 #endif
752 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
753 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
754 static int __Pyx_sys_getdefaultencoding_not_ascii;
755 static int __Pyx_init_sys_getdefaultencoding_params(void) {
756  PyObject* sys;
757  PyObject* default_encoding = NULL;
758  PyObject* ascii_chars_u = NULL;
759  PyObject* ascii_chars_b = NULL;
760  const char* default_encoding_c;
761  sys = PyImport_ImportModule("sys");
762  if (!sys) goto bad;
763  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
764  Py_DECREF(sys);
765  if (!default_encoding) goto bad;
766  default_encoding_c = PyBytes_AsString(default_encoding);
767  if (!default_encoding_c) goto bad;
768  if (strcmp(default_encoding_c, "ascii") == 0) {
769  __Pyx_sys_getdefaultencoding_not_ascii = 0;
770  } else {
771  char ascii_chars[128];
772  int c;
773  for (c = 0; c < 128; c++) {
774  ascii_chars[c] = c;
775  }
776  __Pyx_sys_getdefaultencoding_not_ascii = 1;
777  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
778  if (!ascii_chars_u) goto bad;
779  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
780  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
781  PyErr_Format(
782  PyExc_ValueError,
783  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
784  default_encoding_c);
785  goto bad;
786  }
787  Py_DECREF(ascii_chars_u);
788  Py_DECREF(ascii_chars_b);
789  }
790  Py_DECREF(default_encoding);
791  return 0;
792 bad:
793  Py_XDECREF(default_encoding);
794  Py_XDECREF(ascii_chars_u);
795  Py_XDECREF(ascii_chars_b);
796  return -1;
797 }
798 #endif
799 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
800 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
801 #else
802 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
803 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
804 static char* __PYX_DEFAULT_STRING_ENCODING;
805 static int __Pyx_init_sys_getdefaultencoding_params(void) {
806  PyObject* sys;
807  PyObject* default_encoding = NULL;
808  char* default_encoding_c;
809  sys = PyImport_ImportModule("sys");
810  if (!sys) goto bad;
811  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
812  Py_DECREF(sys);
813  if (!default_encoding) goto bad;
814  default_encoding_c = PyBytes_AsString(default_encoding);
815  if (!default_encoding_c) goto bad;
816  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
817  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
818  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
819  Py_DECREF(default_encoding);
820  return 0;
821 bad:
822  Py_XDECREF(default_encoding);
823  return -1;
824 }
825 #endif
826 #endif
827 
828 
829 /* Test for GCC > 2.95 */
830 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
831  #define likely(x) __builtin_expect(!!(x), 1)
832  #define unlikely(x) __builtin_expect(!!(x), 0)
833 #else /* !__GNUC__ or GCC < 2.95 */
834  #define likely(x) (x)
835  #define unlikely(x) (x)
836 #endif /* __GNUC__ */
837 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
838 
839 static PyObject *__pyx_m = NULL;
840 static PyObject *__pyx_d;
841 static PyObject *__pyx_b;
842 static PyObject *__pyx_cython_runtime = NULL;
843 static PyObject *__pyx_empty_tuple;
844 static PyObject *__pyx_empty_bytes;
845 static PyObject *__pyx_empty_unicode;
846 static int __pyx_lineno;
847 static int __pyx_clineno = 0;
848 static const char * __pyx_cfilenm= __FILE__;
849 static const char *__pyx_filename;
850 
851 /* Header.proto */
852 #if !defined(CYTHON_CCOMPLEX)
853  #if defined(__cplusplus)
854  #define CYTHON_CCOMPLEX 1
855  #elif defined(_Complex_I)
856  #define CYTHON_CCOMPLEX 1
857  #else
858  #define CYTHON_CCOMPLEX 0
859  #endif
860 #endif
861 #if CYTHON_CCOMPLEX
862  #ifdef __cplusplus
863  #include <complex>
864  #else
865  #include <complex.h>
866  #endif
867 #endif
868 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
869  #undef _Complex_I
870  #define _Complex_I 1.0fj
871 #endif
872 
873 
874 static const char *__pyx_f[] = {
875  "proteus/BoundaryConditions.py",
876  "stringsource",
877  "proteus/BoundaryConditions.pxd",
878  "__init__.pxd",
879  "type.pxd",
880 };
881 /* MemviewSliceStruct.proto */
882 struct __pyx_memoryview_obj;
883 typedef struct {
884  struct __pyx_memoryview_obj *memview;
885  char *data;
886  Py_ssize_t shape[8];
887  Py_ssize_t strides[8];
888  Py_ssize_t suboffsets[8];
889 } __Pyx_memviewslice;
890 #define __Pyx_MemoryView_Len(m) (m.shape[0])
891 
892 /* Atomics.proto */
893 #include <pythread.h>
894 #ifndef CYTHON_ATOMICS
895  #define CYTHON_ATOMICS 1
896 #endif
897 #define __pyx_atomic_int_type int
898 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
899  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
900  !defined(__i386__)
901  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
902  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
903  #ifdef __PYX_DEBUG_ATOMICS
904  #warning "Using GNU atomics"
905  #endif
906 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
907  #include <Windows.h>
908  #undef __pyx_atomic_int_type
909  #define __pyx_atomic_int_type LONG
910  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
911  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
912  #ifdef __PYX_DEBUG_ATOMICS
913  #pragma message ("Using MSVC atomics")
914  #endif
915 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
916  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
917  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
918  #ifdef __PYX_DEBUG_ATOMICS
919  #warning "Using Intel atomics"
920  #endif
921 #else
922  #undef CYTHON_ATOMICS
923  #define CYTHON_ATOMICS 0
924  #ifdef __PYX_DEBUG_ATOMICS
925  #warning "Not using atomics"
926  #endif
927 #endif
928 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
929 #if CYTHON_ATOMICS
930  #define __pyx_add_acquisition_count(memview)\
931  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
932  #define __pyx_sub_acquisition_count(memview)\
933  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
934 #else
935  #define __pyx_add_acquisition_count(memview)\
936  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
937  #define __pyx_sub_acquisition_count(memview)\
938  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
939 #endif
940 
941 /* ForceInitThreads.proto */
942 #ifndef __PYX_FORCE_INIT_THREADS
943  #define __PYX_FORCE_INIT_THREADS 0
944 #endif
945 
946 /* NoFastGil.proto */
947 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
948 #define __Pyx_PyGILState_Release PyGILState_Release
949 #define __Pyx_FastGIL_Remember()
950 #define __Pyx_FastGIL_Forget()
951 #define __Pyx_FastGilFuncInit()
952 
953 /* BufferFormatStructs.proto */
954 #define IS_UNSIGNED(type) (((type) -1) > 0)
955 struct __Pyx_StructField_;
956 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
957 typedef struct {
958  const char* name;
959  struct __Pyx_StructField_* fields;
960  size_t size;
961  size_t arraysize[8];
962  int ndim;
963  char typegroup;
964  char is_unsigned;
965  int flags;
966 } __Pyx_TypeInfo;
967 typedef struct __Pyx_StructField_ {
968  __Pyx_TypeInfo* type;
969  const char* name;
970  size_t offset;
971 } __Pyx_StructField;
972 typedef struct {
973  __Pyx_StructField* field;
974  size_t parent_offset;
975 } __Pyx_BufFmt_StackElem;
976 typedef struct {
977  __Pyx_StructField root;
978  __Pyx_BufFmt_StackElem* head;
979  size_t fmt_offset;
980  size_t new_count, enc_count;
981  size_t struct_alignment;
982  int is_complex;
983  char enc_type;
984  char new_packmode;
985  char enc_packmode;
986  char is_valid_array;
987 } __Pyx_BufFmt_Context;
988 
989 
990 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":690
991  * # in Cython to enable them only on the right systems.
992  *
993  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
994  * ctypedef npy_int16 int16_t
995  * ctypedef npy_int32 int32_t
996  */
997 typedef npy_int8 __pyx_t_5numpy_int8_t;
998 
999 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":691
1000  *
1001  * ctypedef npy_int8 int8_t
1002  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1003  * ctypedef npy_int32 int32_t
1004  * ctypedef npy_int64 int64_t
1005  */
1006 typedef npy_int16 __pyx_t_5numpy_int16_t;
1007 
1008 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":692
1009  * ctypedef npy_int8 int8_t
1010  * ctypedef npy_int16 int16_t
1011  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1012  * ctypedef npy_int64 int64_t
1013  * #ctypedef npy_int96 int96_t
1014  */
1015 typedef npy_int32 __pyx_t_5numpy_int32_t;
1016 
1017 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":693
1018  * ctypedef npy_int16 int16_t
1019  * ctypedef npy_int32 int32_t
1020  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1021  * #ctypedef npy_int96 int96_t
1022  * #ctypedef npy_int128 int128_t
1023  */
1024 typedef npy_int64 __pyx_t_5numpy_int64_t;
1025 
1026 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":697
1027  * #ctypedef npy_int128 int128_t
1028  *
1029  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1030  * ctypedef npy_uint16 uint16_t
1031  * ctypedef npy_uint32 uint32_t
1032  */
1033 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1034 
1035 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":698
1036  *
1037  * ctypedef npy_uint8 uint8_t
1038  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1039  * ctypedef npy_uint32 uint32_t
1040  * ctypedef npy_uint64 uint64_t
1041  */
1042 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1043 
1044 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":699
1045  * ctypedef npy_uint8 uint8_t
1046  * ctypedef npy_uint16 uint16_t
1047  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1048  * ctypedef npy_uint64 uint64_t
1049  * #ctypedef npy_uint96 uint96_t
1050  */
1051 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1052 
1053 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":700
1054  * ctypedef npy_uint16 uint16_t
1055  * ctypedef npy_uint32 uint32_t
1056  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1057  * #ctypedef npy_uint96 uint96_t
1058  * #ctypedef npy_uint128 uint128_t
1059  */
1060 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1061 
1062 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":704
1063  * #ctypedef npy_uint128 uint128_t
1064  *
1065  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1066  * ctypedef npy_float64 float64_t
1067  * #ctypedef npy_float80 float80_t
1068  */
1069 typedef npy_float32 __pyx_t_5numpy_float32_t;
1070 
1071 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":705
1072  *
1073  * ctypedef npy_float32 float32_t
1074  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1075  * #ctypedef npy_float80 float80_t
1076  * #ctypedef npy_float128 float128_t
1077  */
1078 typedef npy_float64 __pyx_t_5numpy_float64_t;
1079 
1080 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":714
1081  * # The int types are mapped a bit surprising --
1082  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1083  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1084  * ctypedef npy_longlong long_t
1085  * ctypedef npy_longlong longlong_t
1086  */
1087 typedef npy_long __pyx_t_5numpy_int_t;
1088 
1089 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":715
1090  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1091  * ctypedef npy_long int_t
1092  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1093  * ctypedef npy_longlong longlong_t
1094  *
1095  */
1096 typedef npy_longlong __pyx_t_5numpy_long_t;
1097 
1098 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":716
1099  * ctypedef npy_long int_t
1100  * ctypedef npy_longlong long_t
1101  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1102  *
1103  * ctypedef npy_ulong uint_t
1104  */
1105 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1106 
1107 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":718
1108  * ctypedef npy_longlong longlong_t
1109  *
1110  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1111  * ctypedef npy_ulonglong ulong_t
1112  * ctypedef npy_ulonglong ulonglong_t
1113  */
1114 typedef npy_ulong __pyx_t_5numpy_uint_t;
1115 
1116 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":719
1117  *
1118  * ctypedef npy_ulong uint_t
1119  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1120  * ctypedef npy_ulonglong ulonglong_t
1121  *
1122  */
1123 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1124 
1125 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":720
1126  * ctypedef npy_ulong uint_t
1127  * ctypedef npy_ulonglong ulong_t
1128  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1129  *
1130  * ctypedef npy_intp intp_t
1131  */
1132 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1133 
1134 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":722
1135  * ctypedef npy_ulonglong ulonglong_t
1136  *
1137  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1138  * ctypedef npy_uintp uintp_t
1139  *
1140  */
1141 typedef npy_intp __pyx_t_5numpy_intp_t;
1142 
1143 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":723
1144  *
1145  * ctypedef npy_intp intp_t
1146  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1147  *
1148  * ctypedef npy_double float_t
1149  */
1150 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1151 
1152 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":725
1153  * ctypedef npy_uintp uintp_t
1154  *
1155  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1156  * ctypedef npy_double double_t
1157  * ctypedef npy_longdouble longdouble_t
1158  */
1159 typedef npy_double __pyx_t_5numpy_float_t;
1160 
1161 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":726
1162  *
1163  * ctypedef npy_double float_t
1164  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1165  * ctypedef npy_longdouble longdouble_t
1166  *
1167  */
1168 typedef npy_double __pyx_t_5numpy_double_t;
1169 
1170 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":727
1171  * ctypedef npy_double float_t
1172  * ctypedef npy_double double_t
1173  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1174  *
1175  * ctypedef npy_cfloat cfloat_t
1176  */
1177 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1178 /* Declarations.proto */
1179 #if CYTHON_CCOMPLEX
1180  #ifdef __cplusplus
1181  typedef ::std::complex< float > __pyx_t_float_complex;
1182  #else
1183  typedef float _Complex __pyx_t_float_complex;
1184  #endif
1185 #else
1186  typedef struct { float real, imag; } __pyx_t_float_complex;
1187 #endif
1188 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1189 
1190 /* Declarations.proto */
1191 #if CYTHON_CCOMPLEX
1192  #ifdef __cplusplus
1193  typedef ::std::complex< double > __pyx_t_double_complex;
1194  #else
1195  typedef double _Complex __pyx_t_double_complex;
1196  #endif
1197 #else
1198  typedef struct { double real, imag; } __pyx_t_double_complex;
1199 #endif
1200 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1201 
1202 
1203 /*--- Type declarations ---*/
1204 struct __pyx_obj_18BoundaryConditions_BC_Base;
1205 struct __pyx_obj_18BoundaryConditions_BoundaryCondition;
1206 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC;
1207 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC;
1208 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp;
1209 struct __pyx_array_obj;
1210 struct __pyx_MemviewEnum_obj;
1211 struct __pyx_memoryview_obj;
1212 struct __pyx_memoryviewslice_obj;
1213 
1214 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":729
1215  * ctypedef npy_longdouble longdouble_t
1216  *
1217  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1218  * ctypedef npy_cdouble cdouble_t
1219  * ctypedef npy_clongdouble clongdouble_t
1220  */
1221 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1222 
1223 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":730
1224  *
1225  * ctypedef npy_cfloat cfloat_t
1226  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1227  * ctypedef npy_clongdouble clongdouble_t
1228  *
1229  */
1230 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1231 
1232 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":731
1233  * ctypedef npy_cfloat cfloat_t
1234  * ctypedef npy_cdouble cdouble_t
1235  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1236  *
1237  * ctypedef npy_cdouble complex_t
1238  */
1239 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1240 
1241 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":733
1242  * ctypedef npy_clongdouble clongdouble_t
1243  *
1244  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1245  *
1246  * cdef inline object PyArray_MultiIterNew1(a):
1247  */
1248 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1249 struct __pyx_defaults;
1250 typedef struct __pyx_defaults __pyx_defaults;
1251 struct __pyx_defaults1;
1252 typedef struct __pyx_defaults1 __pyx_defaults1;
1253 struct __pyx_defaults2;
1254 typedef struct __pyx_defaults2 __pyx_defaults2;
1255 
1256 /* "BoundaryConditions.pxd":16
1257  * # cpdef void getContext(BC_Base cls, object context=*)
1258  *
1259  * ctypedef double (*cpp_uOfXT) (BoundaryCondition, double[:], double) # <<<<<<<<<<<<<<
1260  * cdef class BoundaryCondition:
1261  * cdef cpp_uOfXT uuOfXT
1262  */
1263 typedef double (*__pyx_t_18BoundaryConditions_cpp_uOfXT)(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *, __Pyx_memviewslice, double);
1264 struct __pyx_defaults {
1265  PyObject *__pyx_arg_n;
1266 };
1267 struct __pyx_defaults1 {
1268  PyObject *__pyx_arg_n;
1269 };
1270 struct __pyx_defaults2 {
1271  PyObject *__pyx_arg_n;
1272 };
1273 
1274 /* "BoundaryConditions.pxd":5
1275  * import cython
1276  *
1277  * cdef class BC_Base: # <<<<<<<<<<<<<<
1278  * cdef double[:] _b_or
1279  * cdef public:
1280  */
1281 struct __pyx_obj_18BoundaryConditions_BC_Base {
1282  PyObject_HEAD
1283  __Pyx_memviewslice _b_or;
1284  int nd;
1285  PyObject *Shape;
1286  PyObject *name;
1287  PyObject *BC_type;
1288  PyObject *ct;
1289 };
1290 
1291 
1292 /* "BoundaryConditions.pxd":17
1293  *
1294  * ctypedef double (*cpp_uOfXT) (BoundaryCondition, double[:], double)
1295  * cdef class BoundaryCondition: # <<<<<<<<<<<<<<
1296  * cdef cpp_uOfXT uuOfXT
1297  * cdef public:
1298  */
1299 struct __pyx_obj_18BoundaryConditions_BoundaryCondition {
1300  PyObject_HEAD
1301  struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition *__pyx_vtab;
1302  __pyx_t_18BoundaryConditions_cpp_uOfXT uuOfXT;
1303  PyObject *uOfXT;
1304 };
1305 
1306 
1307 /* "BoundaryConditions.py":87
1308  * self.uOfXT = None
1309  *
1310  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
1311  * """
1312  * function returning constant BC
1313  */
1314 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC {
1315  PyObject_HEAD
1316  PyObject *__pyx_v_value;
1317 };
1318 
1319 
1320 /* "BoundaryConditions.py":100
1321  *
1322  *
1323  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
1324  * """
1325  * function returning value=a0+ax*x+ay*y+az*z
1326  */
1327 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC {
1328  PyObject_HEAD
1329  PyObject *__pyx_v_a;
1330  PyObject *__pyx_v_a0;
1331 };
1332 
1333 
1334 /* "BoundaryConditions.py":115
1335  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:])
1336  *
1337  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
1338  * """
1339  * function setting a linear ramp from t=0 to t=t1
1340  */
1341 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp {
1342  PyObject_HEAD
1343  PyObject *__pyx_v_t1;
1344  PyObject *__pyx_v_value;
1345 };
1346 
1347 
1348 /* "View.MemoryView":105
1349  *
1350  * @cname("__pyx_array")
1351  * cdef class array: # <<<<<<<<<<<<<<
1352  *
1353  * cdef:
1354  */
1355 struct __pyx_array_obj {
1356  PyObject_HEAD
1357  struct __pyx_vtabstruct_array *__pyx_vtab;
1358  char *data;
1359  Py_ssize_t len;
1360  char *format;
1361  int ndim;
1362  Py_ssize_t *_shape;
1363  Py_ssize_t *_strides;
1364  Py_ssize_t itemsize;
1365  PyObject *mode;
1366  PyObject *_format;
1367  void (*callback_free_data)(void *);
1368  int free_data;
1369  int dtype_is_object;
1370 };
1371 
1372 
1373 /* "View.MemoryView":279
1374  *
1375  * @cname('__pyx_MemviewEnum')
1376  * cdef class Enum(object): # <<<<<<<<<<<<<<
1377  * cdef object name
1378  * def __init__(self, name):
1379  */
1380 struct __pyx_MemviewEnum_obj {
1381  PyObject_HEAD
1382  PyObject *name;
1383 };
1384 
1385 
1386 /* "View.MemoryView":330
1387  *
1388  * @cname('__pyx_memoryview')
1389  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1390  *
1391  * cdef object obj
1392  */
1393 struct __pyx_memoryview_obj {
1394  PyObject_HEAD
1395  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1396  PyObject *obj;
1397  PyObject *_size;
1398  PyObject *_array_interface;
1399  PyThread_type_lock lock;
1400  __pyx_atomic_int acquisition_count[2];
1401  __pyx_atomic_int *acquisition_count_aligned_p;
1402  Py_buffer view;
1403  int flags;
1404  int dtype_is_object;
1405  __Pyx_TypeInfo *typeinfo;
1406 };
1407 
1408 
1409 /* "View.MemoryView":965
1410  *
1411  * @cname('__pyx_memoryviewslice')
1412  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1413  * "Internal class for passing memoryview slices to Python"
1414  *
1415  */
1416 struct __pyx_memoryviewslice_obj {
1417  struct __pyx_memoryview_obj __pyx_base;
1418  __Pyx_memviewslice from_slice;
1419  PyObject *from_object;
1420  PyObject *(*to_object_func)(char *);
1421  int (*to_dtype_func)(char *, PyObject *);
1422 };
1423 
1424 
1425 
1426 /* "BoundaryConditions.py":68
1427  *
1428  *
1429  * class BoundaryCondition: # <<<<<<<<<<<<<<
1430  * """
1431  * Boundary condition class
1432  */
1433 
1434 struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition {
1435  void (*resetBC)(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *, int __pyx_skip_dispatch);
1436 };
1437 static struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition *__pyx_vtabptr_18BoundaryConditions_BoundaryCondition;
1438 
1439 
1440 /* "View.MemoryView":105
1441  *
1442  * @cname("__pyx_array")
1443  * cdef class array: # <<<<<<<<<<<<<<
1444  *
1445  * cdef:
1446  */
1447 
1448 struct __pyx_vtabstruct_array {
1449  PyObject *(*get_memview)(struct __pyx_array_obj *);
1450 };
1451 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1452 
1453 
1454 /* "View.MemoryView":330
1455  *
1456  * @cname('__pyx_memoryview')
1457  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1458  *
1459  * cdef object obj
1460  */
1461 
1462 struct __pyx_vtabstruct_memoryview {
1463  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1464  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1465  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1466  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1467  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1468  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1469  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1470 };
1471 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1472 
1473 
1474 /* "View.MemoryView":965
1475  *
1476  * @cname('__pyx_memoryviewslice')
1477  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1478  * "Internal class for passing memoryview slices to Python"
1479  *
1480  */
1481 
1482 struct __pyx_vtabstruct__memoryviewslice {
1483  struct __pyx_vtabstruct_memoryview __pyx_base;
1484 };
1485 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1486 
1487 /* --- Runtime support code (head) --- */
1488 /* Refnanny.proto */
1489 #ifndef CYTHON_REFNANNY
1490  #define CYTHON_REFNANNY 0
1491 #endif
1492 #if CYTHON_REFNANNY
1493  typedef struct {
1494  void (*INCREF)(void*, PyObject*, int);
1495  void (*DECREF)(void*, PyObject*, int);
1496  void (*GOTREF)(void*, PyObject*, int);
1497  void (*GIVEREF)(void*, PyObject*, int);
1498  void* (*SetupContext)(const char*, int, const char*);
1499  void (*FinishContext)(void**);
1500  } __Pyx_RefNannyAPIStruct;
1501  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1502  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1503  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1504 #ifdef WITH_THREAD
1505  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1506  if (acquire_gil) {\
1507  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1508  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1509  PyGILState_Release(__pyx_gilstate_save);\
1510  } else {\
1511  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1512  }
1513 #else
1514  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1515  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1516 #endif
1517  #define __Pyx_RefNannyFinishContext()\
1518  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1519  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1520  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1521  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1522  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1523  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1524  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1525  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1526  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1527 #else
1528  #define __Pyx_RefNannyDeclarations
1529  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1530  #define __Pyx_RefNannyFinishContext()
1531  #define __Pyx_INCREF(r) Py_INCREF(r)
1532  #define __Pyx_DECREF(r) Py_DECREF(r)
1533  #define __Pyx_GOTREF(r)
1534  #define __Pyx_GIVEREF(r)
1535  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1536  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1537  #define __Pyx_XGOTREF(r)
1538  #define __Pyx_XGIVEREF(r)
1539 #endif
1540 #define __Pyx_XDECREF_SET(r, v) do {\
1541  PyObject *tmp = (PyObject *) r;\
1542  r = v; __Pyx_XDECREF(tmp);\
1543  } while (0)
1544 #define __Pyx_DECREF_SET(r, v) do {\
1545  PyObject *tmp = (PyObject *) r;\
1546  r = v; __Pyx_DECREF(tmp);\
1547  } while (0)
1548 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1549 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1550 
1551 /* PyObjectGetAttrStr.proto */
1552 #if CYTHON_USE_TYPE_SLOTS
1553 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1554 #else
1555 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1556 #endif
1557 
1558 /* GetBuiltinName.proto */
1559 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1560 
1561 /* RaiseDoubleKeywords.proto */
1562 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1563 
1564 /* ParseKeywords.proto */
1565 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1566  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1567  const char* function_name);
1568 
1569 /* RaiseArgTupleInvalid.proto */
1570 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1571  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1572 
1573 /* PyThreadStateGet.proto */
1574 #if CYTHON_FAST_THREAD_STATE
1575 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1576 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1577 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1578 #else
1579 #define __Pyx_PyThreadState_declare
1580 #define __Pyx_PyThreadState_assign
1581 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1582 #endif
1583 
1584 /* PyErrFetchRestore.proto */
1585 #if CYTHON_FAST_THREAD_STATE
1586 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1587 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1588 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1589 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1590 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1591 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1592 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1593 #if CYTHON_COMPILING_IN_CPYTHON
1594 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1595 #else
1596 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1597 #endif
1598 #else
1599 #define __Pyx_PyErr_Clear() PyErr_Clear()
1600 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1601 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1602 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1603 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1604 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1605 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1606 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1607 #endif
1608 
1609 /* Profile.proto */
1610 #ifndef CYTHON_PROFILE
1611 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1612  #define CYTHON_PROFILE 0
1613 #else
1614  #define CYTHON_PROFILE 1
1615 #endif
1616 #endif
1617 #ifndef CYTHON_TRACE_NOGIL
1618  #define CYTHON_TRACE_NOGIL 0
1619 #else
1620  #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1621  #define CYTHON_TRACE 1
1622  #endif
1623 #endif
1624 #ifndef CYTHON_TRACE
1625  #define CYTHON_TRACE 0
1626 #endif
1627 #if CYTHON_TRACE
1628  #undef CYTHON_PROFILE_REUSE_FRAME
1629 #endif
1630 #ifndef CYTHON_PROFILE_REUSE_FRAME
1631  #define CYTHON_PROFILE_REUSE_FRAME 0
1632 #endif
1633 #if CYTHON_PROFILE || CYTHON_TRACE
1634  #include "compile.h"
1635  #include "frameobject.h"
1636  #include "traceback.h"
1637  #if CYTHON_PROFILE_REUSE_FRAME
1638  #define CYTHON_FRAME_MODIFIER static
1639  #define CYTHON_FRAME_DEL(frame)
1640  #else
1641  #define CYTHON_FRAME_MODIFIER
1642  #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1643  #endif
1644  #define __Pyx_TraceDeclarations\
1645  static PyCodeObject *__pyx_frame_code = NULL;\
1646  CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1647  int __Pyx_use_tracing = 0;
1648  #define __Pyx_TraceFrameInit(codeobj)\
1649  if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1650 #if PY_VERSION_HEX >= 0x030a00b1
1651  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1652  (unlikely((tstate)->cframe->use_tracing) &&\
1653  (!(check_tracing) || !(tstate)->tracing) &&\
1654  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1655  #define __Pyx_SetTracing(tstate, enable)\
1656  (tstate)->cframe->use_tracing = (enable)
1657 #else
1658  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1659  (unlikely((tstate)->use_tracing) &&\
1660  (!(check_tracing) || !(tstate)->tracing) &&\
1661  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1662  #define __Pyx_SetTracing(tstate, enable)\
1663  (tstate)->use_tracing = (enable)
1664 #endif
1665  #ifdef WITH_THREAD
1666  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1667  if (nogil) {\
1668  if (CYTHON_TRACE_NOGIL) {\
1669  PyThreadState *tstate;\
1670  PyGILState_STATE state = PyGILState_Ensure();\
1671  tstate = __Pyx_PyThreadState_Current;\
1672  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1673  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1674  }\
1675  PyGILState_Release(state);\
1676  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1677  }\
1678  } else {\
1679  PyThreadState* tstate = PyThreadState_GET();\
1680  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1681  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1682  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1683  }\
1684  }
1685  #else
1686  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1687  { PyThreadState* tstate = PyThreadState_GET();\
1688  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1689  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1690  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1691  }\
1692  }
1693  #endif
1694  #define __Pyx_TraceException()\
1695  if (likely(!__Pyx_use_tracing)); else {\
1696  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1697  if (__Pyx_IsTracing(tstate, 0, 1)) {\
1698  tstate->tracing++;\
1699  __Pyx_SetTracing(tstate, 0);\
1700  PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1701  if (exc_info) {\
1702  if (CYTHON_TRACE && tstate->c_tracefunc)\
1703  tstate->c_tracefunc(\
1704  tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1705  tstate->c_profilefunc(\
1706  tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1707  Py_DECREF(exc_info);\
1708  }\
1709  __Pyx_SetTracing(tstate, 1);\
1710  tstate->tracing--;\
1711  }\
1712  }
1713  static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1714  PyObject *type, *value, *traceback;
1715  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1716  tstate->tracing++;
1717  __Pyx_SetTracing(tstate, 0);
1718  if (CYTHON_TRACE && tstate->c_tracefunc)
1719  tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1720  if (tstate->c_profilefunc)
1721  tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1722  CYTHON_FRAME_DEL(frame);
1723  __Pyx_SetTracing(tstate, 1);
1724  tstate->tracing--;
1725  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1726  }
1727  #ifdef WITH_THREAD
1728  #define __Pyx_TraceReturn(result, nogil)\
1729  if (likely(!__Pyx_use_tracing)); else {\
1730  if (nogil) {\
1731  if (CYTHON_TRACE_NOGIL) {\
1732  PyThreadState *tstate;\
1733  PyGILState_STATE state = PyGILState_Ensure();\
1734  tstate = __Pyx_PyThreadState_Current;\
1735  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1736  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1737  }\
1738  PyGILState_Release(state);\
1739  }\
1740  } else {\
1741  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1742  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1743  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1744  }\
1745  }\
1746  }
1747  #else
1748  #define __Pyx_TraceReturn(result, nogil)\
1749  if (likely(!__Pyx_use_tracing)); else {\
1750  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1751  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1752  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1753  }\
1754  }
1755  #endif
1756  static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno);
1757  static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno);
1758 #else
1759  #define __Pyx_TraceDeclarations
1760  #define __Pyx_TraceFrameInit(codeobj)
1761  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1762  #define __Pyx_TraceException()
1763  #define __Pyx_TraceReturn(result, nogil)
1764 #endif
1765 #if CYTHON_TRACE
1766  static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) {
1767  int ret;
1768  PyObject *type, *value, *traceback;
1769  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1770  __Pyx_PyFrame_SetLineNumber(frame, lineno);
1771  tstate->tracing++;
1772  __Pyx_SetTracing(tstate, 0);
1773  ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
1774  __Pyx_SetTracing(tstate, 1);
1775  tstate->tracing--;
1776  if (likely(!ret)) {
1777  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1778  } else {
1779  Py_XDECREF(type);
1780  Py_XDECREF(value);
1781  Py_XDECREF(traceback);
1782  }
1783  return ret;
1784  }
1785  #ifdef WITH_THREAD
1786  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1787  if (likely(!__Pyx_use_tracing)); else {\
1788  if (nogil) {\
1789  if (CYTHON_TRACE_NOGIL) {\
1790  int ret = 0;\
1791  PyThreadState *tstate;\
1792  PyGILState_STATE state = PyGILState_Ensure();\
1793  tstate = __Pyx_PyThreadState_Current;\
1794  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1795  ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1796  }\
1797  PyGILState_Release(state);\
1798  if (unlikely(ret)) goto_error;\
1799  }\
1800  } else {\
1801  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1802  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1803  int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1804  if (unlikely(ret)) goto_error;\
1805  }\
1806  }\
1807  }
1808  #else
1809  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1810  if (likely(!__Pyx_use_tracing)); else {\
1811  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1812  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1813  int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1814  if (unlikely(ret)) goto_error;\
1815  }\
1816  }
1817  #endif
1818 #else
1819  #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
1820 #endif
1821 
1822 /* GetItemInt.proto */
1823 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1824  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1825  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1826  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1827  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1828 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1829  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1830  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1831  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1832 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1833  int wraparound, int boundscheck);
1834 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1835  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1836  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1837  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1838 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1839  int wraparound, int boundscheck);
1840 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1841 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1842  int is_list, int wraparound, int boundscheck);
1843 
1844 /* ObjectGetItem.proto */
1845 #if CYTHON_USE_TYPE_SLOTS
1846 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1847 #else
1848 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1849 #endif
1850 
1851 /* MemviewSliceInit.proto */
1852 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1853 #define __Pyx_MEMVIEW_DIRECT 1
1854 #define __Pyx_MEMVIEW_PTR 2
1855 #define __Pyx_MEMVIEW_FULL 4
1856 #define __Pyx_MEMVIEW_CONTIG 8
1857 #define __Pyx_MEMVIEW_STRIDED 16
1858 #define __Pyx_MEMVIEW_FOLLOW 32
1859 #define __Pyx_IS_C_CONTIG 1
1860 #define __Pyx_IS_F_CONTIG 2
1861 static int __Pyx_init_memviewslice(
1862  struct __pyx_memoryview_obj *memview,
1863  int ndim,
1864  __Pyx_memviewslice *memviewslice,
1865  int memview_is_new_reference);
1866 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1867  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1868 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1869  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1870 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1871 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1872 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1873 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1874 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
1875 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
1876 
1877 /* Import.proto */
1878 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1879 
1880 /* ImportFrom.proto */
1881 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1882 
1883 /* PyFunctionFastCall.proto */
1884 #if CYTHON_FAST_PYCALL
1885 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1886  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1887 #if 1 || PY_VERSION_HEX < 0x030600B1
1888 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1889 #else
1890 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1891 #endif
1892 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1893  (sizeof(char [1 - 2*!(cond)]) - 1)
1894 #ifndef Py_MEMBER_SIZE
1895 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1896 #endif
1897  static size_t __pyx_pyframe_localsplus_offset = 0;
1898  #include "frameobject.h"
1899  #define __Pxy_PyFrame_Initialize_Offsets()\
1900  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1901  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1902  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1903  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1904 #endif
1905 
1906 /* PyObjectCall.proto */
1907 #if CYTHON_COMPILING_IN_CPYTHON
1908 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1909 #else
1910 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1911 #endif
1912 
1913 /* PyObjectCallMethO.proto */
1914 #if CYTHON_COMPILING_IN_CPYTHON
1915 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1916 #endif
1917 
1918 /* PyObjectCallNoArg.proto */
1919 #if CYTHON_COMPILING_IN_CPYTHON
1920 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1921 #else
1922 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1923 #endif
1924 
1925 /* PyCFunctionFastCall.proto */
1926 #if CYTHON_FAST_PYCCALL
1927 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1928 #else
1929 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1930 #endif
1931 
1932 /* PyObjectCallOneArg.proto */
1933 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1934 
1935 /* PyErrExceptionMatches.proto */
1936 #if CYTHON_FAST_THREAD_STATE
1937 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1938 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1939 #else
1940 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1941 #endif
1942 
1943 /* GetAttr.proto */
1944 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1945 
1946 /* GetAttr3.proto */
1947 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1948 
1949 /* PyDictVersioning.proto */
1950 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1951 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1952 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1953 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1954  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1955  (cache_var) = (value);
1956 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1957  static PY_UINT64_T __pyx_dict_version = 0;\
1958  static PyObject *__pyx_dict_cached_value = NULL;\
1959  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1960  (VAR) = __pyx_dict_cached_value;\
1961  } else {\
1962  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1963  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1964  }\
1965 }
1966 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1967 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1968 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1969 #else
1970 #define __PYX_GET_DICT_VERSION(dict) (0)
1971 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1972 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1973 #endif
1974 
1975 /* GetModuleGlobalName.proto */
1976 #if CYTHON_USE_DICT_VERSIONS
1977 #define __Pyx_GetModuleGlobalName(var, name) {\
1978  static PY_UINT64_T __pyx_dict_version = 0;\
1979  static PyObject *__pyx_dict_cached_value = NULL;\
1980  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1981  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1982  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1983 }
1984 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1985  PY_UINT64_T __pyx_dict_version;\
1986  PyObject *__pyx_dict_cached_value;\
1987  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1988 }
1989 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1990 #else
1991 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1992 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1993 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1994 #endif
1995 
1996 /* KeywordStringCheck.proto */
1997 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
1998 
1999 /* WriteUnraisableException.proto */
2000 static void __Pyx_WriteUnraisable(const char *name, int clineno,
2001  int lineno, const char *filename,
2002  int full_traceback, int nogil);
2003 
2004 /* None.proto */
2005 static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);
2006 
2007 /* FetchCommonType.proto */
2008 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2009 
2010 /* CythonFunctionShared.proto */
2011 #define __Pyx_CyFunction_USED 1
2012 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2013 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2014 #define __Pyx_CYFUNCTION_CCLASS 0x04
2015 #define __Pyx_CyFunction_GetClosure(f)\
2016  (((__pyx_CyFunctionObject *) (f))->func_closure)
2017 #define __Pyx_CyFunction_GetClassObj(f)\
2018  (((__pyx_CyFunctionObject *) (f))->func_classobj)
2019 #define __Pyx_CyFunction_Defaults(type, f)\
2020  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2021 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2022  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2023 typedef struct {
2024  PyCFunctionObject func;
2025 #if PY_VERSION_HEX < 0x030500A0
2026  PyObject *func_weakreflist;
2027 #endif
2028  PyObject *func_dict;
2029  PyObject *func_name;
2030  PyObject *func_qualname;
2031  PyObject *func_doc;
2032  PyObject *func_globals;
2033  PyObject *func_code;
2034  PyObject *func_closure;
2035  PyObject *func_classobj;
2036  void *defaults;
2037  int defaults_pyobjects;
2038  size_t defaults_size; // used by FusedFunction for copying defaults
2039  int flags;
2040  PyObject *defaults_tuple;
2041  PyObject *defaults_kwdict;
2042  PyObject *(*defaults_getter)(PyObject *);
2043  PyObject *func_annotations;
2044 } __pyx_CyFunctionObject;
2045 static PyTypeObject *__pyx_CyFunctionType = 0;
2046 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2047 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2048  int flags, PyObject* qualname,
2049  PyObject *self,
2050  PyObject *module, PyObject *globals,
2051  PyObject* code);
2052 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2053  size_t size,
2054  int pyobjects);
2055 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2056  PyObject *tuple);
2057 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2058  PyObject *dict);
2059 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2060  PyObject *dict);
2061 static int __pyx_CyFunction_init(void);
2062 
2063 /* CythonFunction.proto */
2064 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2065  int flags, PyObject* qualname,
2066  PyObject *closure,
2067  PyObject *module, PyObject *globals,
2068  PyObject* code);
2069 
2070 /* PyObjectCall2Args.proto */
2071 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
2072 
2073 /* SliceObject.proto */
2074 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
2075  PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
2076  PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
2077  int has_cstart, int has_cstop, int wraparound);
2078 
2079 /* RaiseException.proto */
2080 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2081 
2082 /* HasAttr.proto */
2083 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2084 
2085 /* GetTopmostException.proto */
2086 #if CYTHON_USE_EXC_INFO_STACK
2087 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2088 #endif
2089 
2090 /* SaveResetException.proto */
2091 #if CYTHON_FAST_THREAD_STATE
2092 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2093 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2094 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2095 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2096 #else
2097 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2098 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2099 #endif
2100 
2101 /* GetException.proto */
2102 #if CYTHON_FAST_THREAD_STATE
2103 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2104 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2105 #else
2106 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2107 #endif
2108 
2109 /* ArgTypeTest.proto */
2110 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2111  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2112  __Pyx__ArgTypeTest(obj, type, name, exact))
2113 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2114 
2115 /* IncludeStringH.proto */
2116 #include <string.h>
2117 
2118 /* BytesEquals.proto */
2119 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2120 
2121 /* UnicodeEquals.proto */
2122 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2123 
2124 /* StrEquals.proto */
2125 #if PY_MAJOR_VERSION >= 3
2126 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2127 #else
2128 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2129 #endif
2130 
2131 /* None.proto */
2132 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
2133 
2134 /* UnaryNegOverflows.proto */
2135 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2136  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2137 
2138 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2139 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2140 /* decode_c_string_utf16.proto */
2141 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
2142  int byteorder = 0;
2143  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2144 }
2145 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
2146  int byteorder = -1;
2147  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2148 }
2149 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
2150  int byteorder = 1;
2151  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2152 }
2153 
2154 /* decode_c_string.proto */
2155 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2156  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2157  const char* encoding, const char* errors,
2158  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
2159 
2160 /* RaiseTooManyValuesToUnpack.proto */
2161 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2162 
2163 /* RaiseNeedMoreValuesToUnpack.proto */
2164 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2165 
2166 /* RaiseNoneIterError.proto */
2167 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2168 
2169 /* ExtTypeTest.proto */
2170 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2171 
2172 /* SwapException.proto */
2173 #if CYTHON_FAST_THREAD_STATE
2174 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2175 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2176 #else
2177 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2178 #endif
2179 
2180 /* FastTypeChecks.proto */
2181 #if CYTHON_COMPILING_IN_CPYTHON
2182 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2183 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2184 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2185 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2186 #else
2187 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2188 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2189 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2190 #endif
2191 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2192 
2193 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2194 /* ListCompAppend.proto */
2195 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2196 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2197  PyListObject* L = (PyListObject*) list;
2198  Py_ssize_t len = Py_SIZE(list);
2199  if (likely(L->allocated > len)) {
2200  Py_INCREF(x);
2201  PyList_SET_ITEM(list, len, x);
2202  __Pyx_SET_SIZE(list, len + 1);
2203  return 0;
2204  }
2205  return PyList_Append(list, x);
2206 }
2207 #else
2208 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2209 #endif
2210 
2211 /* PyIntBinop.proto */
2212 #if !CYTHON_COMPILING_IN_PYPY
2213 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2214 #else
2215 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2216  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2217 #endif
2218 
2219 /* ListExtend.proto */
2220 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2221 #if CYTHON_COMPILING_IN_CPYTHON
2222  PyObject* none = _PyList_Extend((PyListObject*)L, v);
2223  if (unlikely(!none))
2224  return -1;
2225  Py_DECREF(none);
2226  return 0;
2227 #else
2228  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2229 #endif
2230 }
2231 
2232 /* ListAppend.proto */
2233 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2234 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2235  PyListObject* L = (PyListObject*) list;
2236  Py_ssize_t len = Py_SIZE(list);
2237  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2238  Py_INCREF(x);
2239  PyList_SET_ITEM(list, len, x);
2240  __Pyx_SET_SIZE(list, len + 1);
2241  return 0;
2242  }
2243  return PyList_Append(list, x);
2244 }
2245 #else
2246 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2247 #endif
2248 
2249 /* None.proto */
2250 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2251 
2252 /* None.proto */
2253 static CYTHON_INLINE long __Pyx_div_long(long, long);
2254 
2255 /* PyObject_GenericGetAttrNoDict.proto */
2256 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2257 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2258 #else
2259 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2260 #endif
2261 
2262 /* PyObject_GenericGetAttr.proto */
2263 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2264 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2265 #else
2266 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2267 #endif
2268 
2269 /* PyObjectGetAttrStrNoError.proto */
2270 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2271 
2272 /* SetupReduce.proto */
2273 static int __Pyx_setup_reduce(PyObject* type_obj);
2274 
2275 /* SetVTable.proto */
2276 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2277 
2278 /* TypeImport.proto */
2279 #ifndef __PYX_HAVE_RT_ImportType_proto
2280 #define __PYX_HAVE_RT_ImportType_proto
2281 enum __Pyx_ImportType_CheckSize {
2282  __Pyx_ImportType_CheckSize_Error = 0,
2283  __Pyx_ImportType_CheckSize_Warn = 1,
2284  __Pyx_ImportType_CheckSize_Ignore = 2
2285 };
2286 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2287 #endif
2288 
2289 /* CLineInTraceback.proto */
2290 #ifdef CYTHON_CLINE_IN_TRACEBACK
2291 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2292 #else
2293 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2294 #endif
2295 
2296 /* CodeObjectCache.proto */
2297 typedef struct {
2298  PyCodeObject* code_object;
2299  int code_line;
2300 } __Pyx_CodeObjectCacheEntry;
2301 struct __Pyx_CodeObjectCache {
2302  int count;
2303  int max_count;
2304  __Pyx_CodeObjectCacheEntry* entries;
2305 };
2306 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2307 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2308 static PyCodeObject *__pyx_find_code_object(int code_line);
2309 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2310 
2311 /* AddTraceback.proto */
2312 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2313  int py_line, const char *filename);
2314 
2315 #if PY_MAJOR_VERSION < 3
2316  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2317  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2318 #else
2319  #define __Pyx_GetBuffer PyObject_GetBuffer
2320  #define __Pyx_ReleaseBuffer PyBuffer_Release
2321 #endif
2322 
2323 
2324 /* BufferStructDeclare.proto */
2325 typedef struct {
2326  Py_ssize_t shape, strides, suboffsets;
2327 } __Pyx_Buf_DimInfo;
2328 typedef struct {
2329  size_t refcount;
2330  Py_buffer pybuffer;
2331 } __Pyx_Buffer;
2332 typedef struct {
2333  __Pyx_Buffer *rcbuffer;
2334  char *data;
2335  __Pyx_Buf_DimInfo diminfo[8];
2336 } __Pyx_LocalBuf_ND;
2337 
2338 /* MemviewSliceIsContig.proto */
2339 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2340 
2341 /* OverlappingSlices.proto */
2342 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2343  __Pyx_memviewslice *slice2,
2344  int ndim, size_t itemsize);
2345 
2346 /* Capsule.proto */
2347 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2348 
2349 /* MemviewDtypeToObject.proto */
2350 static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp);
2351 static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj);
2352 
2353 /* IsLittleEndian.proto */
2354 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2355 
2356 /* BufferFormatCheck.proto */
2357 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2358 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2359  __Pyx_BufFmt_StackElem* stack,
2360  __Pyx_TypeInfo* type);
2361 
2362 /* TypeInfoCompare.proto */
2363 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2364 
2365 /* MemviewSliceValidateAndInit.proto */
2366 static int __Pyx_ValidateAndInit_memviewslice(
2367  int *axes_specs,
2368  int c_or_f_flag,
2369  int buf_flags,
2370  int ndim,
2371  __Pyx_TypeInfo *dtype,
2372  __Pyx_BufFmt_StackElem stack[],
2373  __Pyx_memviewslice *memviewslice,
2374  PyObject *original_obj);
2375 
2376 /* ObjectToMemviewSlice.proto */
2377 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
2378 
2379 /* GCCDiagnostics.proto */
2380 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2381 #define __Pyx_HAS_GCC_DIAGNOSTIC
2382 #endif
2383 
2384 /* RealImag.proto */
2385 #if CYTHON_CCOMPLEX
2386  #ifdef __cplusplus
2387  #define __Pyx_CREAL(z) ((z).real())
2388  #define __Pyx_CIMAG(z) ((z).imag())
2389  #else
2390  #define __Pyx_CREAL(z) (__real__(z))
2391  #define __Pyx_CIMAG(z) (__imag__(z))
2392  #endif
2393 #else
2394  #define __Pyx_CREAL(z) ((z).real)
2395  #define __Pyx_CIMAG(z) ((z).imag)
2396 #endif
2397 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2398  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2399  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2400  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2401 #else
2402  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2403  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2404 #endif
2405 
2406 /* Arithmetic.proto */
2407 #if CYTHON_CCOMPLEX
2408  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2409  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2410  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2411  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2412  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2413  #define __Pyx_c_neg_float(a) (-(a))
2414  #ifdef __cplusplus
2415  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2416  #define __Pyx_c_conj_float(z) (::std::conj(z))
2417  #if 1
2418  #define __Pyx_c_abs_float(z) (::std::abs(z))
2419  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2420  #endif
2421  #else
2422  #define __Pyx_c_is_zero_float(z) ((z)==0)
2423  #define __Pyx_c_conj_float(z) (conjf(z))
2424  #if 1
2425  #define __Pyx_c_abs_float(z) (cabsf(z))
2426  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2427  #endif
2428  #endif
2429 #else
2430  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2431  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2432  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2433  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2434  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2435  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2436  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2437  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2438  #if 1
2439  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2440  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2441  #endif
2442 #endif
2443 
2444 /* Arithmetic.proto */
2445 #if CYTHON_CCOMPLEX
2446  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2447  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2448  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2449  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2450  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2451  #define __Pyx_c_neg_double(a) (-(a))
2452  #ifdef __cplusplus
2453  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2454  #define __Pyx_c_conj_double(z) (::std::conj(z))
2455  #if 1
2456  #define __Pyx_c_abs_double(z) (::std::abs(z))
2457  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2458  #endif
2459  #else
2460  #define __Pyx_c_is_zero_double(z) ((z)==0)
2461  #define __Pyx_c_conj_double(z) (conj(z))
2462  #if 1
2463  #define __Pyx_c_abs_double(z) (cabs(z))
2464  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2465  #endif
2466  #endif
2467 #else
2468  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2469  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2470  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2471  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2472  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2473  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2474  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2475  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2476  #if 1
2477  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2478  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2479  #endif
2480 #endif
2481 
2482 /* MemviewSliceCopyTemplate.proto */
2483 static __Pyx_memviewslice
2484 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2485  const char *mode, int ndim,
2486  size_t sizeof_dtype, int contig_flag,
2487  int dtype_is_object);
2488 
2489 /* CIntToPy.proto */
2490 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2491 
2492 /* CIntFromPy.proto */
2493 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2494 
2495 /* CIntFromPy.proto */
2496 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2497 
2498 /* CIntToPy.proto */
2499 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2500 
2501 /* CIntFromPy.proto */
2502 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2503 
2504 /* CheckBinaryVersion.proto */
2505 static int __Pyx_check_binary_version(void);
2506 
2507 /* InitStrings.proto */
2508 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2509 
2510 static void __pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
2511 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2512 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2513 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2514 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2515 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2516 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2517 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2518 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2519 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2520 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2521 
2522 /* Module declarations from 'cython.view' */
2523 
2524 /* Module declarations from 'cython' */
2525 
2526 /* Module declarations from 'cpython.buffer' */
2527 
2528 /* Module declarations from 'libc.string' */
2529 
2530 /* Module declarations from 'libc.stdio' */
2531 
2532 /* Module declarations from '__builtin__' */
2533 
2534 /* Module declarations from 'cpython.type' */
2535 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2536 
2537 /* Module declarations from 'cpython' */
2538 
2539 /* Module declarations from 'cpython.object' */
2540 
2541 /* Module declarations from 'cpython.ref' */
2542 
2543 /* Module declarations from 'cpython.mem' */
2544 
2545 /* Module declarations from 'numpy' */
2546 
2547 /* Module declarations from 'numpy' */
2548 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2549 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2550 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2551 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2552 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2553 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2554 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2555 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2556 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2557 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2558 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2559 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2560 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2561 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2562 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2563 
2564 /* Module declarations from 'BoundaryConditions' */
2565 static PyTypeObject *__pyx_ptype_18BoundaryConditions_BC_Base = 0;
2566 static PyTypeObject *__pyx_ptype_18BoundaryConditions_BoundaryCondition = 0;
2567 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC = 0;
2568 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = 0;
2569 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = 0;
2570 static PyTypeObject *__pyx_array_type = 0;
2571 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2572 static PyTypeObject *__pyx_memoryview_type = 0;
2573 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2574 static PyObject *generic = 0;
2575 static PyObject *strided = 0;
2576 static PyObject *indirect = 0;
2577 static PyObject *contiguous = 0;
2578 static PyObject *indirect_contiguous = 0;
2579 static int __pyx_memoryview_thread_locks_used;
2580 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2581 static PyObject *__pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(struct __pyx_obj_18BoundaryConditions_BC_Base *, PyObject *); /*proto*/
2582 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2583 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2584 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2585 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2586 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2587 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2588 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2589 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2590 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2591 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2592 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2593 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2594 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2595 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2596 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2597 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2598 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2599 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2600 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2601 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2602 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2603 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2604 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2605 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2606 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2607 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2608 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2609 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2610 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2611 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2612 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2613 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2614 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2615 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2616 #define __Pyx_MODULE_NAME "BoundaryConditions"
2617 extern int __pyx_module_is_main_BoundaryConditions;
2618 int __pyx_module_is_main_BoundaryConditions = 0;
2619 
2620 /* Implementation of 'BoundaryConditions' */
2621 static PyObject *__pyx_builtin_sum;
2622 static PyObject *__pyx_builtin_TypeError;
2623 static PyObject *__pyx_builtin_ImportError;
2624 static PyObject *__pyx_builtin_ValueError;
2625 static PyObject *__pyx_builtin_MemoryError;
2626 static PyObject *__pyx_builtin_enumerate;
2627 static PyObject *__pyx_builtin_range;
2628 static PyObject *__pyx_builtin_Ellipsis;
2629 static PyObject *__pyx_builtin_id;
2630 static PyObject *__pyx_builtin_IndexError;
2631 static const char __pyx_k_O[] = "O";
2632 static const char __pyx_k_a[] = "a";
2633 static const char __pyx_k_c[] = "c";
2634 static const char __pyx_k_n[] = "n";
2635 static const char __pyx_k_t[] = "t";
2636 static const char __pyx_k_x[] = "x";
2637 static const char __pyx_k_a0[] = "a0";
2638 static const char __pyx_k_id[] = "id";
2639 static const char __pyx_k_nd[] = "nd";
2640 static const char __pyx_k_np[] = "np";
2641 static const char __pyx_k_t1[] = "t1";
2642 static const char __pyx_k_all[] = "__all__";
2643 static const char __pyx_k_b_i[] = "b_i";
2644 static const char __pyx_k_get[] = "get";
2645 static const char __pyx_k_new[] = "__new__";
2646 static const char __pyx_k_obj[] = "obj";
2647 static const char __pyx_k_sum[] = "sum";
2648 static const char __pyx_k_None[] = "None";
2649 static const char __pyx_k_b_or[] = "b_or";
2650 static const char __pyx_k_base[] = "base";
2651 static const char __pyx_k_dict[] = "__dict__";
2652 static const char __pyx_k_main[] = "__main__";
2653 static const char __pyx_k_mode[] = "mode";
2654 static const char __pyx_k_name[] = "name";
2655 static const char __pyx_k_ndim[] = "ndim";
2656 static const char __pyx_k_pack[] = "pack";
2657 static const char __pyx_k_self[] = "self";
2658 static const char __pyx_k_size[] = "size";
2659 static const char __pyx_k_step[] = "step";
2660 static const char __pyx_k_stop[] = "stop";
2661 static const char __pyx_k_test[] = "__test__";
2662 static const char __pyx_k_ASCII[] = "ASCII";
2663 static const char __pyx_k_class[] = "__class__";
2664 static const char __pyx_k_error[] = "error";
2665 static const char __pyx_k_flags[] = "flags";
2666 static const char __pyx_k_numpy[] = "numpy";
2667 static const char __pyx_k_range[] = "range";
2668 static const char __pyx_k_shape[] = "shape";
2669 static const char __pyx_k_start[] = "start";
2670 static const char __pyx_k_state[] = "state";
2671 static const char __pyx_k_value[] = "value";
2672 static const char __pyx_k_zeros[] = "zeros";
2673 static const char __pyx_k_Domain[] = "Domain";
2674 static const char __pyx_k_dict_2[] = "_dict";
2675 static const char __pyx_k_encode[] = "encode";
2676 static const char __pyx_k_format[] = "format";
2677 static const char __pyx_k_import[] = "__import__";
2678 static const char __pyx_k_name_2[] = "__name__";
2679 static const char __pyx_k_pickle[] = "pickle";
2680 static const char __pyx_k_reduce[] = "__reduce__";
2681 static const char __pyx_k_struct[] = "struct";
2682 static const char __pyx_k_unpack[] = "unpack";
2683 static const char __pyx_k_update[] = "update";
2684 static const char __pyx_k_BC_Base[] = "BC_Base";
2685 static const char __pyx_k_Context[] = "Context";
2686 static const char __pyx_k_context[] = "context";
2687 static const char __pyx_k_fortran[] = "fortran";
2688 static const char __pyx_k_memview[] = "memview";
2689 static const char __pyx_k_proteus[] = "proteus";
2690 static const char __pyx_k_resetBC[] = "resetBC";
2691 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2692 static const char __pyx_k_getstate[] = "__getstate__";
2693 static const char __pyx_k_itemsize[] = "itemsize";
2694 static const char __pyx_k_pyx_type[] = "__pyx_type";
2695 static const char __pyx_k_setstate[] = "__setstate__";
2696 static const char __pyx_k_TypeError[] = "TypeError";
2697 static const char __pyx_k_enumerate[] = "enumerate";
2698 static const char __pyx_k_pyx_state[] = "__pyx_state";
2699 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2700 static const char __pyx_k_IndexError[] = "IndexError";
2701 static const char __pyx_k_ValueError[] = "ValueError";
2702 static const char __pyx_k_getContext[] = "getContext";
2703 static const char __pyx_k_pyx_result[] = "__pyx_result";
2704 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2705 static const char __pyx_k_ImportError[] = "ImportError";
2706 static const char __pyx_k_MemoryError[] = "MemoryError";
2707 static const char __pyx_k_PickleError[] = "PickleError";
2708 static const char __pyx_k_init_cython[] = "init_cython";
2709 static const char __pyx_k_setLinearBC[] = "setLinearBC";
2710 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2711 static const char __pyx_k_stringsource[] = "stringsource";
2712 static const char __pyx_k_use_setstate[] = "use_setstate";
2713 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2714 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2715 static const char __pyx_k_setConstantBC[] = "setConstantBC";
2716 static const char __pyx_k_setLinearRamp[] = "setLinearRamp";
2717 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2718 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2719 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2720 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2721 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2722 static const char __pyx_k_BoundaryCondition[] = "BoundaryCondition";
2723 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2724 static const char __pyx_k_BC_Base_getContext[] = "BC_Base.getContext";
2725 static const char __pyx_k_BoundaryConditions[] = "BoundaryConditions";
2726 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2727 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2728 static const char __pyx_k_pyx_unpickle_BC_Base[] = "__pyx_unpickle_BC_Base";
2729 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2730 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2731 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2732 static const char __pyx_k_BC_Base___reduce_cython[] = "BC_Base.__reduce_cython__";
2733 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2734 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2735 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2736 static const char __pyx_k_BC_Base___setstate_cython[] = "BC_Base.__setstate_cython__";
2737 static const char __pyx_k_BoundaryCondition_resetBC[] = "BoundaryCondition.resetBC";
2738 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2739 static const char __pyx_k_setLinearBC_locals_lambda[] = "setLinearBC.<locals>.<lambda>";
2740 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2741 static const char __pyx_k_setConstantBC_locals_lambda[] = "setConstantBC.<locals>.<lambda>";
2742 static const char __pyx_k_setLinearRamp_locals_lambda[] = "setLinearRamp.<locals>.<lambda>";
2743 static const char __pyx_k_BoundaryCondition_init_cython[] = "BoundaryCondition.init_cython";
2744 static const char __pyx_k_BoundaryCondition_setLinearBC[] = "BoundaryCondition.setLinearBC";
2745 static const char __pyx_k_proteus_BoundaryConditions_py[] = "proteus/BoundaryConditions.py";
2746 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2747 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2748 static const char __pyx_k_BoundaryCondition_setConstantBC[] = "BoundaryCondition.setConstantBC";
2749 static const char __pyx_k_BoundaryCondition_setLinearRamp[] = "BoundaryCondition.setLinearRamp";
2750 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2751 static const char __pyx_k_self_uuOfXT_cannot_be_converted[] = "self.uuOfXT cannot be converted to a Python object for pickling";
2752 static const char __pyx_k_BoundaryCondition___reduce_cytho[] = "BoundaryCondition.__reduce_cython__";
2753 static const char __pyx_k_BoundaryCondition___setstate_cyt[] = "BoundaryCondition.__setstate_cython__";
2754 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2755 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2756 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2757 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2758 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2759 static const char __pyx_k_Incompatible_checksums_s_vs_0x96[] = "Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))";
2760 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
2761 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2762 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2763 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2764 static const char __pyx_k_Shape_or_nd_must_be_passed_to_BC[] = "Shape or nd must be passed to BC";
2765 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2766 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2767 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2768 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2769 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2770 static PyObject *__pyx_n_s_ASCII;
2771 static PyObject *__pyx_n_s_BC_Base;
2772 static PyObject *__pyx_n_s_BC_Base___reduce_cython;
2773 static PyObject *__pyx_n_s_BC_Base___setstate_cython;
2774 static PyObject *__pyx_n_s_BC_Base_getContext;
2775 static PyObject *__pyx_n_s_BoundaryCondition;
2776 static PyObject *__pyx_n_s_BoundaryCondition___reduce_cytho;
2777 static PyObject *__pyx_n_s_BoundaryCondition___setstate_cyt;
2778 static PyObject *__pyx_n_s_BoundaryCondition_init_cython;
2779 static PyObject *__pyx_n_s_BoundaryCondition_resetBC;
2780 static PyObject *__pyx_n_s_BoundaryCondition_setConstantBC;
2781 static PyObject *__pyx_n_s_BoundaryCondition_setLinearBC;
2782 static PyObject *__pyx_n_s_BoundaryCondition_setLinearRamp;
2783 static PyObject *__pyx_n_s_BoundaryConditions;
2784 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2785 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2786 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2787 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2788 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2789 static PyObject *__pyx_n_s_Context;
2790 static PyObject *__pyx_n_s_Domain;
2791 static PyObject *__pyx_n_s_Ellipsis;
2792 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2793 static PyObject *__pyx_n_s_ImportError;
2794 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x96;
2795 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2796 static PyObject *__pyx_n_s_IndexError;
2797 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2798 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2799 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2800 static PyObject *__pyx_n_s_MemoryError;
2801 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2802 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2803 static PyObject *__pyx_n_s_None;
2804 static PyObject *__pyx_n_b_O;
2805 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2806 static PyObject *__pyx_n_s_PickleError;
2807 static PyObject *__pyx_kp_s_Shape_or_nd_must_be_passed_to_BC;
2808 static PyObject *__pyx_n_s_TypeError;
2809 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2810 static PyObject *__pyx_n_s_ValueError;
2811 static PyObject *__pyx_n_s_View_MemoryView;
2812 static PyObject *__pyx_n_s_a;
2813 static PyObject *__pyx_n_s_a0;
2814 static PyObject *__pyx_n_s_all;
2815 static PyObject *__pyx_n_s_allocate_buffer;
2816 static PyObject *__pyx_n_s_b_i;
2817 static PyObject *__pyx_n_s_b_or;
2818 static PyObject *__pyx_n_s_base;
2819 static PyObject *__pyx_n_s_c;
2820 static PyObject *__pyx_n_u_c;
2821 static PyObject *__pyx_n_s_class;
2822 static PyObject *__pyx_n_s_cline_in_traceback;
2823 static PyObject *__pyx_n_s_context;
2824 static PyObject *__pyx_kp_s_contiguous_and_direct;
2825 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2826 static PyObject *__pyx_n_s_dict;
2827 static PyObject *__pyx_n_s_dict_2;
2828 static PyObject *__pyx_n_s_dtype_is_object;
2829 static PyObject *__pyx_n_s_encode;
2830 static PyObject *__pyx_n_s_enumerate;
2831 static PyObject *__pyx_n_s_error;
2832 static PyObject *__pyx_n_s_flags;
2833 static PyObject *__pyx_n_s_format;
2834 static PyObject *__pyx_n_s_fortran;
2835 static PyObject *__pyx_n_u_fortran;
2836 static PyObject *__pyx_n_s_get;
2837 static PyObject *__pyx_n_s_getContext;
2838 static PyObject *__pyx_n_s_getstate;
2839 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2840 static PyObject *__pyx_n_s_id;
2841 static PyObject *__pyx_n_s_import;
2842 static PyObject *__pyx_n_s_init_cython;
2843 static PyObject *__pyx_n_s_itemsize;
2844 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2845 static PyObject *__pyx_n_s_main;
2846 static PyObject *__pyx_n_s_memview;
2847 static PyObject *__pyx_n_s_mode;
2848 static PyObject *__pyx_n_s_n;
2849 static PyObject *__pyx_n_s_name;
2850 static PyObject *__pyx_n_s_name_2;
2851 static PyObject *__pyx_n_s_nd;
2852 static PyObject *__pyx_n_s_ndim;
2853 static PyObject *__pyx_n_s_new;
2854 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2855 static PyObject *__pyx_n_s_np;
2856 static PyObject *__pyx_n_s_numpy;
2857 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2858 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2859 static PyObject *__pyx_n_s_obj;
2860 static PyObject *__pyx_n_s_pack;
2861 static PyObject *__pyx_n_s_pickle;
2862 static PyObject *__pyx_n_s_proteus;
2863 static PyObject *__pyx_kp_s_proteus_BoundaryConditions_py;
2864 static PyObject *__pyx_n_s_pyx_PickleError;
2865 static PyObject *__pyx_n_s_pyx_checksum;
2866 static PyObject *__pyx_n_s_pyx_getbuffer;
2867 static PyObject *__pyx_n_s_pyx_result;
2868 static PyObject *__pyx_n_s_pyx_state;
2869 static PyObject *__pyx_n_s_pyx_type;
2870 static PyObject *__pyx_n_s_pyx_unpickle_BC_Base;
2871 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2872 static PyObject *__pyx_n_s_pyx_vtable;
2873 static PyObject *__pyx_n_s_range;
2874 static PyObject *__pyx_n_s_reduce;
2875 static PyObject *__pyx_n_s_reduce_cython;
2876 static PyObject *__pyx_n_s_reduce_ex;
2877 static PyObject *__pyx_n_s_resetBC;
2878 static PyObject *__pyx_n_s_self;
2879 static PyObject *__pyx_kp_s_self_uuOfXT_cannot_be_converted;
2880 static PyObject *__pyx_n_s_setConstantBC;
2881 static PyObject *__pyx_n_s_setConstantBC_locals_lambda;
2882 static PyObject *__pyx_n_s_setLinearBC;
2883 static PyObject *__pyx_n_s_setLinearBC_locals_lambda;
2884 static PyObject *__pyx_n_s_setLinearRamp;
2885 static PyObject *__pyx_n_s_setLinearRamp_locals_lambda;
2886 static PyObject *__pyx_n_s_setstate;
2887 static PyObject *__pyx_n_s_setstate_cython;
2888 static PyObject *__pyx_n_s_shape;
2889 static PyObject *__pyx_n_s_size;
2890 static PyObject *__pyx_n_s_start;
2891 static PyObject *__pyx_n_s_state;
2892 static PyObject *__pyx_n_s_step;
2893 static PyObject *__pyx_n_s_stop;
2894 static PyObject *__pyx_kp_s_strided_and_direct;
2895 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2896 static PyObject *__pyx_kp_s_strided_and_indirect;
2897 static PyObject *__pyx_kp_s_stringsource;
2898 static PyObject *__pyx_n_s_struct;
2899 static PyObject *__pyx_n_s_sum;
2900 static PyObject *__pyx_n_s_t;
2901 static PyObject *__pyx_n_s_t1;
2902 static PyObject *__pyx_n_s_test;
2903 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2904 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2905 static PyObject *__pyx_n_s_unpack;
2906 static PyObject *__pyx_n_s_update;
2907 static PyObject *__pyx_n_s_use_setstate;
2908 static PyObject *__pyx_n_s_value;
2909 static PyObject *__pyx_n_s_x;
2910 static PyObject *__pyx_n_s_zeros;
2911 static int __pyx_pf_18BoundaryConditions_7BC_Base___init__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_name, PyObject *__pyx_v_b_or, PyObject *__pyx_v_b_i, PyObject *__pyx_v_nd); /* proto */
2912 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2getContext(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
2913 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2914 static int __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2915 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2916 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2917 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2918 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2919 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2920 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2921 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2922 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2923 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2924 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2925 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2926 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2927 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2928 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2929 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2930 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2931 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2932 static PyObject *__pyx_pf_18BoundaryConditions_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
2933 static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n); /* proto */
2934 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2935 static PyObject *__pyx_pf_18BoundaryConditions_4__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
2936 static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n); /* proto */
2937 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_a0, PyObject *__pyx_v_a); /* proto */
2938 static PyObject *__pyx_pf_18BoundaryConditions_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
2939 static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n); /* proto */
2940 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_t1, PyObject *__pyx_v_value); /* proto */
2941 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2942 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2943 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2944 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2945 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2946 static PyObject *__pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2947 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2948 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2949 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2950 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2951 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2952 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2953 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2954 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2955 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2956 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2957 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2958 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2959 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2960 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2961 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2962 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2963 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2964 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2965 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2966 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2967 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2968 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2969 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2970 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2971 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2972 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2973 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2974 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2975 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2976 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2977 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2978 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2979 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2980 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2981 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2982 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2983 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2984 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2985 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2986 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2987 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2988 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2989 static PyObject *__pyx_tp_new_18BoundaryConditions_BC_Base(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2990 static PyObject *__pyx_tp_new_18BoundaryConditions_BoundaryCondition(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2991 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2992 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2993 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2994 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2995 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2996 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2997 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2998 static PyObject *__pyx_int_0;
2999 static PyObject *__pyx_int_1;
3000 static PyObject *__pyx_int_3;
3001 static PyObject *__pyx_int_158231071;
3002 static PyObject *__pyx_int_184977713;
3003 static PyObject *__pyx_int_neg_1;
3004 static PyObject *__pyx_codeobj_;
3005 static PyObject *__pyx_slice__7;
3006 static PyObject *__pyx_tuple__11;
3007 static PyObject *__pyx_tuple__13;
3008 static PyObject *__pyx_tuple__15;
3009 static PyObject *__pyx_tuple__16;
3010 static PyObject *__pyx_tuple__17;
3011 static PyObject *__pyx_tuple__18;
3012 static PyObject *__pyx_tuple__19;
3013 static PyObject *__pyx_tuple__20;
3014 static PyObject *__pyx_tuple__21;
3015 static PyObject *__pyx_tuple__22;
3016 static PyObject *__pyx_tuple__23;
3017 static PyObject *__pyx_tuple__24;
3018 static PyObject *__pyx_tuple__25;
3019 static PyObject *__pyx_tuple__26;
3020 static PyObject *__pyx_tuple__27;
3021 static PyObject *__pyx_tuple__28;
3022 static PyObject *__pyx_tuple__29;
3023 static PyObject *__pyx_tuple__30;
3024 static PyObject *__pyx_tuple__31;
3025 static PyObject *__pyx_tuple__32;
3026 static PyObject *__pyx_tuple__33;
3027 static PyObject *__pyx_tuple__35;
3028 static PyObject *__pyx_tuple__36;
3029 static PyObject *__pyx_tuple__37;
3030 static PyObject *__pyx_tuple__38;
3031 static PyObject *__pyx_tuple__39;
3032 static PyObject *__pyx_tuple__40;
3033 static PyObject *__pyx_tuple__41;
3034 static PyObject *__pyx_tuple__42;
3035 static PyObject *__pyx_tuple__43;
3036 static PyObject *__pyx_tuple__44;
3037 static PyObject *__pyx_tuple__45;
3038 static PyObject *__pyx_tuple__46;
3039 static PyObject *__pyx_tuple__47;
3040 static PyObject *__pyx_tuple__48;
3041 static PyObject *__pyx_tuple__49;
3042 static PyObject *__pyx_tuple__50;
3043 static PyObject *__pyx_tuple__51;
3044 static PyObject *__pyx_codeobj__2;
3045 static PyObject *__pyx_codeobj__3;
3046 static PyObject *__pyx_codeobj__4;
3047 static PyObject *__pyx_codeobj__5;
3048 static PyObject *__pyx_codeobj__6;
3049 static PyObject *__pyx_codeobj__8;
3050 static PyObject *__pyx_codeobj__9;
3051 static PyObject *__pyx_codeobj__10;
3052 static PyObject *__pyx_codeobj__12;
3053 static PyObject *__pyx_codeobj__14;
3054 static PyObject *__pyx_codeobj__34;
3055 /* Late includes */
3056 
3057 /* "BoundaryConditions.py":24
3058  * Generic class regrouping boundary conditions
3059  * """
3060  * def __init__(self, shape=None, name=None, b_or=None, b_i=0, nd=None): # <<<<<<<<<<<<<<
3061  * self.Shape = shape
3062  * self.name = name
3063  */
3064 
3065 /* Python wrapper */
3066 static int __pyx_pw_18BoundaryConditions_7BC_Base_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3067 static int __pyx_pw_18BoundaryConditions_7BC_Base_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3068  PyObject *__pyx_v_shape = 0;
3069  PyObject *__pyx_v_name = 0;
3070  PyObject *__pyx_v_b_or = 0;
3071  PyObject *__pyx_v_b_i = 0;
3072  PyObject *__pyx_v_nd = 0;
3073  int __pyx_lineno = 0;
3074  const char *__pyx_filename = NULL;
3075  int __pyx_clineno = 0;
3076  int __pyx_r;
3077  __Pyx_RefNannyDeclarations
3078  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
3079  {
3080  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_name,&__pyx_n_s_b_or,&__pyx_n_s_b_i,&__pyx_n_s_nd,0};
3081  PyObject* values[5] = {0,0,0,0,0};
3082  values[0] = ((PyObject *)Py_None);
3083  values[1] = ((PyObject *)Py_None);
3084  values[2] = ((PyObject *)Py_None);
3085  values[3] = ((PyObject *)__pyx_int_0);
3086  values[4] = ((PyObject *)Py_None);
3087  if (unlikely(__pyx_kwds)) {
3088  Py_ssize_t kw_args;
3089  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3090  switch (pos_args) {
3091  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3092  CYTHON_FALLTHROUGH;
3093  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3094  CYTHON_FALLTHROUGH;
3095  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3096  CYTHON_FALLTHROUGH;
3097  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3098  CYTHON_FALLTHROUGH;
3099  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3100  CYTHON_FALLTHROUGH;
3101  case 0: break;
3102  default: goto __pyx_L5_argtuple_error;
3103  }
3104  kw_args = PyDict_Size(__pyx_kwds);
3105  switch (pos_args) {
3106  case 0:
3107  if (kw_args > 0) {
3108  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape);
3109  if (value) { values[0] = value; kw_args--; }
3110  }
3111  CYTHON_FALLTHROUGH;
3112  case 1:
3113  if (kw_args > 0) {
3114  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
3115  if (value) { values[1] = value; kw_args--; }
3116  }
3117  CYTHON_FALLTHROUGH;
3118  case 2:
3119  if (kw_args > 0) {
3120  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b_or);
3121  if (value) { values[2] = value; kw_args--; }
3122  }
3123  CYTHON_FALLTHROUGH;
3124  case 3:
3125  if (kw_args > 0) {
3126  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b_i);
3127  if (value) { values[3] = value; kw_args--; }
3128  }
3129  CYTHON_FALLTHROUGH;
3130  case 4:
3131  if (kw_args > 0) {
3132  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd);
3133  if (value) { values[4] = value; kw_args--; }
3134  }
3135  }
3136  if (unlikely(kw_args > 0)) {
3137  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 24, __pyx_L3_error)
3138  }
3139  } else {
3140  switch (PyTuple_GET_SIZE(__pyx_args)) {
3141  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3142  CYTHON_FALLTHROUGH;
3143  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3144  CYTHON_FALLTHROUGH;
3145  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3146  CYTHON_FALLTHROUGH;
3147  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3148  CYTHON_FALLTHROUGH;
3149  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3150  CYTHON_FALLTHROUGH;
3151  case 0: break;
3152  default: goto __pyx_L5_argtuple_error;
3153  }
3154  }
3155  __pyx_v_shape = values[0];
3156  __pyx_v_name = values[1];
3157  __pyx_v_b_or = values[2];
3158  __pyx_v_b_i = values[3];
3159  __pyx_v_nd = values[4];
3160  }
3161  goto __pyx_L4_argument_unpacking_done;
3162  __pyx_L5_argtuple_error:;
3163  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 24, __pyx_L3_error)
3164  __pyx_L3_error:;
3165  __Pyx_AddTraceback("BoundaryConditions.BC_Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3166  __Pyx_RefNannyFinishContext();
3167  return -1;
3168  __pyx_L4_argument_unpacking_done:;
3169  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base___init__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), __pyx_v_shape, __pyx_v_name, __pyx_v_b_or, __pyx_v_b_i, __pyx_v_nd);
3170 
3171  /* function exit code */
3172  __Pyx_RefNannyFinishContext();
3173  return __pyx_r;
3174 }
3175 
3176 static int __pyx_pf_18BoundaryConditions_7BC_Base___init__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_name, PyObject *__pyx_v_b_or, PyObject *__pyx_v_b_i, PyObject *__pyx_v_nd) {
3177  int __pyx_r;
3178  __Pyx_TraceDeclarations
3179  __Pyx_RefNannyDeclarations
3180  PyObject *__pyx_t_1 = NULL;
3181  int __pyx_t_2;
3182  int __pyx_t_3;
3183  PyObject *__pyx_t_4 = NULL;
3184  int __pyx_t_5;
3185  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
3186  int __pyx_lineno = 0;
3187  const char *__pyx_filename = NULL;
3188  int __pyx_clineno = 0;
3189  __Pyx_RefNannySetupContext("__init__", 0);
3190  __Pyx_TraceCall("__init__", __pyx_f[0], 24, 0, __PYX_ERR(0, 24, __pyx_L1_error));
3191 
3192  /* "BoundaryConditions.py":25
3193  * """
3194  * def __init__(self, shape=None, name=None, b_or=None, b_i=0, nd=None):
3195  * self.Shape = shape # <<<<<<<<<<<<<<
3196  * self.name = name
3197  * self.BC_type = 'None'
3198  */
3199  __Pyx_INCREF(__pyx_v_shape);
3200  __Pyx_GIVEREF(__pyx_v_shape);
3201  __Pyx_GOTREF(__pyx_v_self->Shape);
3202  __Pyx_DECREF(__pyx_v_self->Shape);
3203  __pyx_v_self->Shape = __pyx_v_shape;
3204 
3205  /* "BoundaryConditions.py":26
3206  * def __init__(self, shape=None, name=None, b_or=None, b_i=0, nd=None):
3207  * self.Shape = shape
3208  * self.name = name # <<<<<<<<<<<<<<
3209  * self.BC_type = 'None'
3210  * if shape is not None:
3211  */
3212  if (!(likely(PyString_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(0, 26, __pyx_L1_error)
3213  __pyx_t_1 = __pyx_v_name;
3214  __Pyx_INCREF(__pyx_t_1);
3215  __Pyx_GIVEREF(__pyx_t_1);
3216  __Pyx_GOTREF(__pyx_v_self->name);
3217  __Pyx_DECREF(__pyx_v_self->name);
3218  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
3219  __pyx_t_1 = 0;
3220 
3221  /* "BoundaryConditions.py":27
3222  * self.Shape = shape
3223  * self.name = name
3224  * self.BC_type = 'None' # <<<<<<<<<<<<<<
3225  * if shape is not None:
3226  * self.nd = self.Shape.Domain.nd
3227  */
3228  __Pyx_INCREF(__pyx_n_s_None);
3229  __Pyx_GIVEREF(__pyx_n_s_None);
3230  __Pyx_GOTREF(__pyx_v_self->BC_type);
3231  __Pyx_DECREF(__pyx_v_self->BC_type);
3232  __pyx_v_self->BC_type = __pyx_n_s_None;
3233 
3234  /* "BoundaryConditions.py":28
3235  * self.name = name
3236  * self.BC_type = 'None'
3237  * if shape is not None: # <<<<<<<<<<<<<<
3238  * self.nd = self.Shape.Domain.nd
3239  * elif nd is not None:
3240  */
3241  __pyx_t_2 = (__pyx_v_shape != Py_None);
3242  __pyx_t_3 = (__pyx_t_2 != 0);
3243  if (__pyx_t_3) {
3244 
3245  /* "BoundaryConditions.py":29
3246  * self.BC_type = 'None'
3247  * if shape is not None:
3248  * self.nd = self.Shape.Domain.nd # <<<<<<<<<<<<<<
3249  * elif nd is not None:
3250  * self.nd = nd
3251  */
3252  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->Shape, __pyx_n_s_Domain); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
3253  __Pyx_GOTREF(__pyx_t_1);
3254  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nd); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error)
3255  __Pyx_GOTREF(__pyx_t_4);
3256  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3257  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L1_error)
3258  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3259  __pyx_v_self->nd = __pyx_t_5;
3260 
3261  /* "BoundaryConditions.py":28
3262  * self.name = name
3263  * self.BC_type = 'None'
3264  * if shape is not None: # <<<<<<<<<<<<<<
3265  * self.nd = self.Shape.Domain.nd
3266  * elif nd is not None:
3267  */
3268  goto __pyx_L3;
3269  }
3270 
3271  /* "BoundaryConditions.py":30
3272  * if shape is not None:
3273  * self.nd = self.Shape.Domain.nd
3274  * elif nd is not None: # <<<<<<<<<<<<<<
3275  * self.nd = nd
3276  * else:
3277  */
3278  __pyx_t_3 = (__pyx_v_nd != Py_None);
3279  __pyx_t_2 = (__pyx_t_3 != 0);
3280  if (__pyx_t_2) {
3281 
3282  /* "BoundaryConditions.py":31
3283  * self.nd = self.Shape.Domain.nd
3284  * elif nd is not None:
3285  * self.nd = nd # <<<<<<<<<<<<<<
3286  * else:
3287  * assert nd is not None, 'Shape or nd must be passed to BC'
3288  */
3289  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_nd); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error)
3290  __pyx_v_self->nd = __pyx_t_5;
3291 
3292  /* "BoundaryConditions.py":30
3293  * if shape is not None:
3294  * self.nd = self.Shape.Domain.nd
3295  * elif nd is not None: # <<<<<<<<<<<<<<
3296  * self.nd = nd
3297  * else:
3298  */
3299  goto __pyx_L3;
3300  }
3301 
3302  /* "BoundaryConditions.py":33
3303  * self.nd = nd
3304  * else:
3305  * assert nd is not None, 'Shape or nd must be passed to BC' # <<<<<<<<<<<<<<
3306  * if b_or is not None:
3307  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape
3308  */
3309  /*else*/ {
3310  #ifndef CYTHON_WITHOUT_ASSERTIONS
3311  if (unlikely(!Py_OptimizeFlag)) {
3312  __pyx_t_2 = (__pyx_v_nd != Py_None);
3313  if (unlikely(!(__pyx_t_2 != 0))) {
3314  PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_Shape_or_nd_must_be_passed_to_BC);
3315  __PYX_ERR(0, 33, __pyx_L1_error)
3316  }
3317  }
3318  #endif
3319  }
3320  __pyx_L3:;
3321 
3322  /* "BoundaryConditions.py":34
3323  * else:
3324  * assert nd is not None, 'Shape or nd must be passed to BC'
3325  * if b_or is not None: # <<<<<<<<<<<<<<
3326  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape
3327  * else:
3328  */
3329  __pyx_t_2 = (__pyx_v_b_or != Py_None);
3330  __pyx_t_3 = (__pyx_t_2 != 0);
3331  if (__pyx_t_3) {
3332 
3333  /* "BoundaryConditions.py":35
3334  * assert nd is not None, 'Shape or nd must be passed to BC'
3335  * if b_or is not None:
3336  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape # <<<<<<<<<<<<<<
3337  * else:
3338  * self._b_or = None
3339  */
3340  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_b_or, __pyx_v_b_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error)
3341  __Pyx_GOTREF(__pyx_t_4);
3342  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 35, __pyx_L1_error)
3343  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3344  __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b_or, 0);
3345  __pyx_v_self->_b_or = __pyx_t_6;
3346  __pyx_t_6.memview = NULL;
3347  __pyx_t_6.data = NULL;
3348 
3349  /* "BoundaryConditions.py":34
3350  * else:
3351  * assert nd is not None, 'Shape or nd must be passed to BC'
3352  * if b_or is not None: # <<<<<<<<<<<<<<
3353  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape
3354  * else:
3355  */
3356  goto __pyx_L4;
3357  }
3358 
3359  /* "BoundaryConditions.py":37
3360  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape
3361  * else:
3362  * self._b_or = None # <<<<<<<<<<<<<<
3363  *
3364  * # @staticmethod
3365  */
3366  /*else*/ {
3367  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 37, __pyx_L1_error)
3368  __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b_or, 0);
3369  __pyx_v_self->_b_or = __pyx_t_6;
3370  __pyx_t_6.memview = NULL;
3371  __pyx_t_6.data = NULL;
3372  }
3373  __pyx_L4:;
3374 
3375  /* "BoundaryConditions.py":24
3376  * Generic class regrouping boundary conditions
3377  * """
3378  * def __init__(self, shape=None, name=None, b_or=None, b_i=0, nd=None): # <<<<<<<<<<<<<<
3379  * self.Shape = shape
3380  * self.name = name
3381  */
3382 
3383  /* function exit code */
3384  __pyx_r = 0;
3385  goto __pyx_L0;
3386  __pyx_L1_error:;
3387  __Pyx_XDECREF(__pyx_t_1);
3388  __Pyx_XDECREF(__pyx_t_4);
3389  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
3390  __Pyx_AddTraceback("BoundaryConditions.BC_Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3391  __pyx_r = -1;
3392  __pyx_L0:;
3393  __Pyx_TraceReturn(Py_None, 0);
3394  __Pyx_RefNannyFinishContext();
3395  return __pyx_r;
3396 }
3397 
3398 /* "BoundaryConditions.py":52
3399  * # setattr(BC_Base, name, default_value)
3400  *
3401  * def getContext(self, context=None): # <<<<<<<<<<<<<<
3402  * """
3403  * Gets context from proteus.Context or
3404  */
3405 
3406 /* Python wrapper */
3407 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_3getContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3408 static char __pyx_doc_18BoundaryConditions_7BC_Base_2getContext[] = "BC_Base.getContext(self, context=None)\n\n Gets context from proteus.Context or\n\n Parameters\n ----------\n context: class, optional\n if set to None, the context will be created from proteus.Context\n ";
3409 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_3getContext = {"getContext", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_7BC_Base_3getContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_7BC_Base_2getContext};
3410 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_3getContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3411  PyObject *__pyx_v_context = 0;
3412  int __pyx_lineno = 0;
3413  const char *__pyx_filename = NULL;
3414  int __pyx_clineno = 0;
3415  PyObject *__pyx_r = 0;
3416  __Pyx_RefNannyDeclarations
3417  __Pyx_RefNannySetupContext("getContext (wrapper)", 0);
3418  {
3419  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0};
3420  PyObject* values[1] = {0};
3421  values[0] = ((PyObject *)Py_None);
3422  if (unlikely(__pyx_kwds)) {
3423  Py_ssize_t kw_args;
3424  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3425  switch (pos_args) {
3426  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3427  CYTHON_FALLTHROUGH;
3428  case 0: break;
3429  default: goto __pyx_L5_argtuple_error;
3430  }
3431  kw_args = PyDict_Size(__pyx_kwds);
3432  switch (pos_args) {
3433  case 0:
3434  if (kw_args > 0) {
3435  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
3436  if (value) { values[0] = value; kw_args--; }
3437  }
3438  }
3439  if (unlikely(kw_args > 0)) {
3440  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getContext") < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
3441  }
3442  } else {
3443  switch (PyTuple_GET_SIZE(__pyx_args)) {
3444  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3445  CYTHON_FALLTHROUGH;
3446  case 0: break;
3447  default: goto __pyx_L5_argtuple_error;
3448  }
3449  }
3450  __pyx_v_context = values[0];
3451  }
3452  goto __pyx_L4_argument_unpacking_done;
3453  __pyx_L5_argtuple_error:;
3454  __Pyx_RaiseArgtupleInvalid("getContext", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error)
3455  __pyx_L3_error:;
3456  __Pyx_AddTraceback("BoundaryConditions.BC_Base.getContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
3457  __Pyx_RefNannyFinishContext();
3458  return NULL;
3459  __pyx_L4_argument_unpacking_done:;
3460  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2getContext(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), __pyx_v_context);
3461 
3462  /* function exit code */
3463  __Pyx_RefNannyFinishContext();
3464  return __pyx_r;
3465 }
3466 
3467 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2getContext(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_context) {
3468  PyObject *__pyx_v_Context = NULL;
3469  PyObject *__pyx_r = NULL;
3470  __Pyx_TraceDeclarations
3471  __Pyx_RefNannyDeclarations
3472  int __pyx_t_1;
3473  PyObject *__pyx_t_2 = NULL;
3474  PyObject *__pyx_t_3 = NULL;
3475  PyObject *__pyx_t_4 = NULL;
3476  int __pyx_lineno = 0;
3477  const char *__pyx_filename = NULL;
3478  int __pyx_clineno = 0;
3479  __Pyx_TraceFrameInit(__pyx_codeobj_)
3480  __Pyx_RefNannySetupContext("getContext", 0);
3481  __Pyx_TraceCall("getContext", __pyx_f[0], 52, 0, __PYX_ERR(0, 52, __pyx_L1_error));
3482 
3483  /* "BoundaryConditions.py":61
3484  * if set to None, the context will be created from proteus.Context
3485  * """
3486  * if context: # <<<<<<<<<<<<<<
3487  * from proteus import Context
3488  * self.ct = Context.get()
3489  */
3490  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_context); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 61, __pyx_L1_error)
3491  if (__pyx_t_1) {
3492 
3493  /* "BoundaryConditions.py":62
3494  * """
3495  * if context:
3496  * from proteus import Context # <<<<<<<<<<<<<<
3497  * self.ct = Context.get()
3498  * else:
3499  */
3500  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
3501  __Pyx_GOTREF(__pyx_t_2);
3502  __Pyx_INCREF(__pyx_n_s_Context);
3503  __Pyx_GIVEREF(__pyx_n_s_Context);
3504  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Context);
3505  __pyx_t_3 = __Pyx_Import(__pyx_n_s_proteus, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
3506  __Pyx_GOTREF(__pyx_t_3);
3507  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3508  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Context); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
3509  __Pyx_GOTREF(__pyx_t_2);
3510  __Pyx_INCREF(__pyx_t_2);
3511  __pyx_v_Context = __pyx_t_2;
3512  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3513  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3514 
3515  /* "BoundaryConditions.py":63
3516  * if context:
3517  * from proteus import Context
3518  * self.ct = Context.get() # <<<<<<<<<<<<<<
3519  * else:
3520  * self.ct = context
3521  */
3522  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_Context, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
3523  __Pyx_GOTREF(__pyx_t_2);
3524  __pyx_t_4 = NULL;
3525  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3526  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
3527  if (likely(__pyx_t_4)) {
3528  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3529  __Pyx_INCREF(__pyx_t_4);
3530  __Pyx_INCREF(function);
3531  __Pyx_DECREF_SET(__pyx_t_2, function);
3532  }
3533  }
3534  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
3535  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3536  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __pyx_L1_error)
3537  __Pyx_GOTREF(__pyx_t_3);
3538  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3539  __Pyx_GIVEREF(__pyx_t_3);
3540  __Pyx_GOTREF(__pyx_v_self->ct);
3541  __Pyx_DECREF(__pyx_v_self->ct);
3542  __pyx_v_self->ct = __pyx_t_3;
3543  __pyx_t_3 = 0;
3544 
3545  /* "BoundaryConditions.py":61
3546  * if set to None, the context will be created from proteus.Context
3547  * """
3548  * if context: # <<<<<<<<<<<<<<
3549  * from proteus import Context
3550  * self.ct = Context.get()
3551  */
3552  goto __pyx_L3;
3553  }
3554 
3555  /* "BoundaryConditions.py":65
3556  * self.ct = Context.get()
3557  * else:
3558  * self.ct = context # <<<<<<<<<<<<<<
3559  *
3560  *
3561  */
3562  /*else*/ {
3563  __Pyx_INCREF(__pyx_v_context);
3564  __Pyx_GIVEREF(__pyx_v_context);
3565  __Pyx_GOTREF(__pyx_v_self->ct);
3566  __Pyx_DECREF(__pyx_v_self->ct);
3567  __pyx_v_self->ct = __pyx_v_context;
3568  }
3569  __pyx_L3:;
3570 
3571  /* "BoundaryConditions.py":52
3572  * # setattr(BC_Base, name, default_value)
3573  *
3574  * def getContext(self, context=None): # <<<<<<<<<<<<<<
3575  * """
3576  * Gets context from proteus.Context or
3577  */
3578 
3579  /* function exit code */
3580  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3581  goto __pyx_L0;
3582  __pyx_L1_error:;
3583  __Pyx_XDECREF(__pyx_t_2);
3584  __Pyx_XDECREF(__pyx_t_3);
3585  __Pyx_XDECREF(__pyx_t_4);
3586  __Pyx_AddTraceback("BoundaryConditions.BC_Base.getContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
3587  __pyx_r = NULL;
3588  __pyx_L0:;
3589  __Pyx_XDECREF(__pyx_v_Context);
3590  __Pyx_XGIVEREF(__pyx_r);
3591  __Pyx_TraceReturn(__pyx_r, 0);
3592  __Pyx_RefNannyFinishContext();
3593  return __pyx_r;
3594 }
3595 
3596 /* "BoundaryConditions.pxd":8
3597  * cdef double[:] _b_or
3598  * cdef public:
3599  * cdef int nd # <<<<<<<<<<<<<<
3600  * object Shape
3601  * str name
3602  */
3603 
3604 /* Python wrapper */
3605 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(PyObject *__pyx_v_self); /*proto*/
3606 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(PyObject *__pyx_v_self) {
3607  PyObject *__pyx_r = 0;
3608  __Pyx_RefNannyDeclarations
3609  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3610  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3611 
3612  /* function exit code */
3613  __Pyx_RefNannyFinishContext();
3614  return __pyx_r;
3615 }
3616 
3617 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3618  PyObject *__pyx_r = NULL;
3619  __Pyx_TraceDeclarations
3620  __Pyx_RefNannyDeclarations
3621  PyObject *__pyx_t_1 = NULL;
3622  int __pyx_lineno = 0;
3623  const char *__pyx_filename = NULL;
3624  int __pyx_clineno = 0;
3625  __Pyx_RefNannySetupContext("__get__", 0);
3626  __Pyx_TraceCall("__get__", __pyx_f[2], 8, 0, __PYX_ERR(2, 8, __pyx_L1_error));
3627  __Pyx_XDECREF(__pyx_r);
3628  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nd); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
3629  __Pyx_GOTREF(__pyx_t_1);
3630  __pyx_r = __pyx_t_1;
3631  __pyx_t_1 = 0;
3632  goto __pyx_L0;
3633 
3634  /* function exit code */
3635  __pyx_L1_error:;
3636  __Pyx_XDECREF(__pyx_t_1);
3637  __Pyx_AddTraceback("BoundaryConditions.BC_Base.nd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3638  __pyx_r = NULL;
3639  __pyx_L0:;
3640  __Pyx_XGIVEREF(__pyx_r);
3641  __Pyx_TraceReturn(__pyx_r, 0);
3642  __Pyx_RefNannyFinishContext();
3643  return __pyx_r;
3644 }
3645 
3646 /* Python wrapper */
3647 static int __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3648 static int __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3649  int __pyx_r;
3650  __Pyx_RefNannyDeclarations
3651  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3652  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3653 
3654  /* function exit code */
3655  __Pyx_RefNannyFinishContext();
3656  return __pyx_r;
3657 }
3658 
3659 static int __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3660  int __pyx_r;
3661  __Pyx_TraceDeclarations
3662  __Pyx_RefNannyDeclarations
3663  int __pyx_t_1;
3664  int __pyx_lineno = 0;
3665  const char *__pyx_filename = NULL;
3666  int __pyx_clineno = 0;
3667  __Pyx_RefNannySetupContext("__set__", 0);
3668  __Pyx_TraceCall("__set__", __pyx_f[2], 8, 0, __PYX_ERR(2, 8, __pyx_L1_error));
3669  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8, __pyx_L1_error)
3670  __pyx_v_self->nd = __pyx_t_1;
3671 
3672  /* function exit code */
3673  __pyx_r = 0;
3674  goto __pyx_L0;
3675  __pyx_L1_error:;
3676  __Pyx_AddTraceback("BoundaryConditions.BC_Base.nd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3677  __pyx_r = -1;
3678  __pyx_L0:;
3679  __Pyx_TraceReturn(Py_None, 0);
3680  __Pyx_RefNannyFinishContext();
3681  return __pyx_r;
3682 }
3683 
3684 /* "BoundaryConditions.pxd":9
3685  * cdef public:
3686  * cdef int nd
3687  * object Shape # <<<<<<<<<<<<<<
3688  * str name
3689  * str BC_type
3690  */
3691 
3692 /* Python wrapper */
3693 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(PyObject *__pyx_v_self); /*proto*/
3694 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(PyObject *__pyx_v_self) {
3695  PyObject *__pyx_r = 0;
3696  __Pyx_RefNannyDeclarations
3697  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3698  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3699 
3700  /* function exit code */
3701  __Pyx_RefNannyFinishContext();
3702  return __pyx_r;
3703 }
3704 
3705 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3706  PyObject *__pyx_r = NULL;
3707  __Pyx_TraceDeclarations
3708  __Pyx_RefNannyDeclarations
3709  int __pyx_lineno = 0;
3710  const char *__pyx_filename = NULL;
3711  int __pyx_clineno = 0;
3712  __Pyx_RefNannySetupContext("__get__", 0);
3713  __Pyx_TraceCall("__get__", __pyx_f[2], 9, 0, __PYX_ERR(2, 9, __pyx_L1_error));
3714  __Pyx_XDECREF(__pyx_r);
3715  __Pyx_INCREF(__pyx_v_self->Shape);
3716  __pyx_r = __pyx_v_self->Shape;
3717  goto __pyx_L0;
3718 
3719  /* function exit code */
3720  __pyx_L1_error:;
3721  __Pyx_AddTraceback("BoundaryConditions.BC_Base.Shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3722  __pyx_r = NULL;
3723  __pyx_L0:;
3724  __Pyx_XGIVEREF(__pyx_r);
3725  __Pyx_TraceReturn(__pyx_r, 0);
3726  __Pyx_RefNannyFinishContext();
3727  return __pyx_r;
3728 }
3729 
3730 /* Python wrapper */
3731 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3732 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3733  int __pyx_r;
3734  __Pyx_RefNannyDeclarations
3735  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3736  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3737 
3738  /* function exit code */
3739  __Pyx_RefNannyFinishContext();
3740  return __pyx_r;
3741 }
3742 
3743 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3744  int __pyx_r;
3745  __Pyx_TraceDeclarations
3746  __Pyx_RefNannyDeclarations
3747  int __pyx_lineno = 0;
3748  const char *__pyx_filename = NULL;
3749  int __pyx_clineno = 0;
3750  __Pyx_RefNannySetupContext("__set__", 0);
3751  __Pyx_TraceCall("__set__", __pyx_f[2], 9, 0, __PYX_ERR(2, 9, __pyx_L1_error));
3752  __Pyx_INCREF(__pyx_v_value);
3753  __Pyx_GIVEREF(__pyx_v_value);
3754  __Pyx_GOTREF(__pyx_v_self->Shape);
3755  __Pyx_DECREF(__pyx_v_self->Shape);
3756  __pyx_v_self->Shape = __pyx_v_value;
3757 
3758  /* function exit code */
3759  __pyx_r = 0;
3760  goto __pyx_L0;
3761  __pyx_L1_error:;
3762  __Pyx_AddTraceback("BoundaryConditions.BC_Base.Shape.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3763  __pyx_r = -1;
3764  __pyx_L0:;
3765  __Pyx_TraceReturn(Py_None, 0);
3766  __Pyx_RefNannyFinishContext();
3767  return __pyx_r;
3768 }
3769 
3770 /* Python wrapper */
3771 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(PyObject *__pyx_v_self); /*proto*/
3772 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(PyObject *__pyx_v_self) {
3773  int __pyx_r;
3774  __Pyx_RefNannyDeclarations
3775  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
3776  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3777 
3778  /* function exit code */
3779  __Pyx_RefNannyFinishContext();
3780  return __pyx_r;
3781 }
3782 
3783 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3784  int __pyx_r;
3785  __Pyx_TraceDeclarations
3786  __Pyx_RefNannyDeclarations
3787  int __pyx_lineno = 0;
3788  const char *__pyx_filename = NULL;
3789  int __pyx_clineno = 0;
3790  __Pyx_RefNannySetupContext("__del__", 0);
3791  __Pyx_TraceCall("__del__", __pyx_f[2], 9, 0, __PYX_ERR(2, 9, __pyx_L1_error));
3792  __Pyx_INCREF(Py_None);
3793  __Pyx_GIVEREF(Py_None);
3794  __Pyx_GOTREF(__pyx_v_self->Shape);
3795  __Pyx_DECREF(__pyx_v_self->Shape);
3796  __pyx_v_self->Shape = Py_None;
3797 
3798  /* function exit code */
3799  __pyx_r = 0;
3800  goto __pyx_L0;
3801  __pyx_L1_error:;
3802  __Pyx_AddTraceback("BoundaryConditions.BC_Base.Shape.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3803  __pyx_r = -1;
3804  __pyx_L0:;
3805  __Pyx_TraceReturn(Py_None, 0);
3806  __Pyx_RefNannyFinishContext();
3807  return __pyx_r;
3808 }
3809 
3810 /* "BoundaryConditions.pxd":10
3811  * cdef int nd
3812  * object Shape
3813  * str name # <<<<<<<<<<<<<<
3814  * str BC_type
3815  * object ct
3816  */
3817 
3818 /* Python wrapper */
3819 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
3820 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(PyObject *__pyx_v_self) {
3821  PyObject *__pyx_r = 0;
3822  __Pyx_RefNannyDeclarations
3823  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3824  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3825 
3826  /* function exit code */
3827  __Pyx_RefNannyFinishContext();
3828  return __pyx_r;
3829 }
3830 
3831 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3832  PyObject *__pyx_r = NULL;
3833  __Pyx_TraceDeclarations
3834  __Pyx_RefNannyDeclarations
3835  int __pyx_lineno = 0;
3836  const char *__pyx_filename = NULL;
3837  int __pyx_clineno = 0;
3838  __Pyx_RefNannySetupContext("__get__", 0);
3839  __Pyx_TraceCall("__get__", __pyx_f[2], 10, 0, __PYX_ERR(2, 10, __pyx_L1_error));
3840  __Pyx_XDECREF(__pyx_r);
3841  __Pyx_INCREF(__pyx_v_self->name);
3842  __pyx_r = __pyx_v_self->name;
3843  goto __pyx_L0;
3844 
3845  /* function exit code */
3846  __pyx_L1_error:;
3847  __Pyx_AddTraceback("BoundaryConditions.BC_Base.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3848  __pyx_r = NULL;
3849  __pyx_L0:;
3850  __Pyx_XGIVEREF(__pyx_r);
3851  __Pyx_TraceReturn(__pyx_r, 0);
3852  __Pyx_RefNannyFinishContext();
3853  return __pyx_r;
3854 }
3855 
3856 /* Python wrapper */
3857 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3858 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3859  int __pyx_r;
3860  __Pyx_RefNannyDeclarations
3861  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3862  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3863 
3864  /* function exit code */
3865  __Pyx_RefNannyFinishContext();
3866  return __pyx_r;
3867 }
3868 
3869 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3870  int __pyx_r;
3871  __Pyx_TraceDeclarations
3872  __Pyx_RefNannyDeclarations
3873  PyObject *__pyx_t_1 = NULL;
3874  int __pyx_lineno = 0;
3875  const char *__pyx_filename = NULL;
3876  int __pyx_clineno = 0;
3877  __Pyx_RefNannySetupContext("__set__", 0);
3878  __Pyx_TraceCall("__set__", __pyx_f[2], 10, 0, __PYX_ERR(2, 10, __pyx_L1_error));
3879  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error)
3880  __pyx_t_1 = __pyx_v_value;
3881  __Pyx_INCREF(__pyx_t_1);
3882  __Pyx_GIVEREF(__pyx_t_1);
3883  __Pyx_GOTREF(__pyx_v_self->name);
3884  __Pyx_DECREF(__pyx_v_self->name);
3885  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
3886  __pyx_t_1 = 0;
3887 
3888  /* function exit code */
3889  __pyx_r = 0;
3890  goto __pyx_L0;
3891  __pyx_L1_error:;
3892  __Pyx_XDECREF(__pyx_t_1);
3893  __Pyx_AddTraceback("BoundaryConditions.BC_Base.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3894  __pyx_r = -1;
3895  __pyx_L0:;
3896  __Pyx_TraceReturn(Py_None, 0);
3897  __Pyx_RefNannyFinishContext();
3898  return __pyx_r;
3899 }
3900 
3901 /* Python wrapper */
3902 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
3903 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(PyObject *__pyx_v_self) {
3904  int __pyx_r;
3905  __Pyx_RefNannyDeclarations
3906  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
3907  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3908 
3909  /* function exit code */
3910  __Pyx_RefNannyFinishContext();
3911  return __pyx_r;
3912 }
3913 
3914 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3915  int __pyx_r;
3916  __Pyx_TraceDeclarations
3917  __Pyx_RefNannyDeclarations
3918  int __pyx_lineno = 0;
3919  const char *__pyx_filename = NULL;
3920  int __pyx_clineno = 0;
3921  __Pyx_RefNannySetupContext("__del__", 0);
3922  __Pyx_TraceCall("__del__", __pyx_f[2], 10, 0, __PYX_ERR(2, 10, __pyx_L1_error));
3923  __Pyx_INCREF(Py_None);
3924  __Pyx_GIVEREF(Py_None);
3925  __Pyx_GOTREF(__pyx_v_self->name);
3926  __Pyx_DECREF(__pyx_v_self->name);
3927  __pyx_v_self->name = ((PyObject*)Py_None);
3928 
3929  /* function exit code */
3930  __pyx_r = 0;
3931  goto __pyx_L0;
3932  __pyx_L1_error:;
3933  __Pyx_AddTraceback("BoundaryConditions.BC_Base.name.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3934  __pyx_r = -1;
3935  __pyx_L0:;
3936  __Pyx_TraceReturn(Py_None, 0);
3937  __Pyx_RefNannyFinishContext();
3938  return __pyx_r;
3939 }
3940 
3941 /* "BoundaryConditions.pxd":11
3942  * object Shape
3943  * str name
3944  * str BC_type # <<<<<<<<<<<<<<
3945  * object ct
3946  * # cpdef void newGlobalBC(BC_Base cls, newstr name, object default_value)
3947  */
3948 
3949 /* Python wrapper */
3950 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(PyObject *__pyx_v_self); /*proto*/
3951 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(PyObject *__pyx_v_self) {
3952  PyObject *__pyx_r = 0;
3953  __Pyx_RefNannyDeclarations
3954  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3955  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3956 
3957  /* function exit code */
3958  __Pyx_RefNannyFinishContext();
3959  return __pyx_r;
3960 }
3961 
3962 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3963  PyObject *__pyx_r = NULL;
3964  __Pyx_TraceDeclarations
3965  __Pyx_RefNannyDeclarations
3966  int __pyx_lineno = 0;
3967  const char *__pyx_filename = NULL;
3968  int __pyx_clineno = 0;
3969  __Pyx_RefNannySetupContext("__get__", 0);
3970  __Pyx_TraceCall("__get__", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
3971  __Pyx_XDECREF(__pyx_r);
3972  __Pyx_INCREF(__pyx_v_self->BC_type);
3973  __pyx_r = __pyx_v_self->BC_type;
3974  goto __pyx_L0;
3975 
3976  /* function exit code */
3977  __pyx_L1_error:;
3978  __Pyx_AddTraceback("BoundaryConditions.BC_Base.BC_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3979  __pyx_r = NULL;
3980  __pyx_L0:;
3981  __Pyx_XGIVEREF(__pyx_r);
3982  __Pyx_TraceReturn(__pyx_r, 0);
3983  __Pyx_RefNannyFinishContext();
3984  return __pyx_r;
3985 }
3986 
3987 /* Python wrapper */
3988 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3989 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3990  int __pyx_r;
3991  __Pyx_RefNannyDeclarations
3992  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3993  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3994 
3995  /* function exit code */
3996  __Pyx_RefNannyFinishContext();
3997  return __pyx_r;
3998 }
3999 
4000 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
4001  int __pyx_r;
4002  __Pyx_TraceDeclarations
4003  __Pyx_RefNannyDeclarations
4004  PyObject *__pyx_t_1 = NULL;
4005  int __pyx_lineno = 0;
4006  const char *__pyx_filename = NULL;
4007  int __pyx_clineno = 0;
4008  __Pyx_RefNannySetupContext("__set__", 0);
4009  __Pyx_TraceCall("__set__", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
4010  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 11, __pyx_L1_error)
4011  __pyx_t_1 = __pyx_v_value;
4012  __Pyx_INCREF(__pyx_t_1);
4013  __Pyx_GIVEREF(__pyx_t_1);
4014  __Pyx_GOTREF(__pyx_v_self->BC_type);
4015  __Pyx_DECREF(__pyx_v_self->BC_type);
4016  __pyx_v_self->BC_type = ((PyObject*)__pyx_t_1);
4017  __pyx_t_1 = 0;
4018 
4019  /* function exit code */
4020  __pyx_r = 0;
4021  goto __pyx_L0;
4022  __pyx_L1_error:;
4023  __Pyx_XDECREF(__pyx_t_1);
4024  __Pyx_AddTraceback("BoundaryConditions.BC_Base.BC_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4025  __pyx_r = -1;
4026  __pyx_L0:;
4027  __Pyx_TraceReturn(Py_None, 0);
4028  __Pyx_RefNannyFinishContext();
4029  return __pyx_r;
4030 }
4031 
4032 /* Python wrapper */
4033 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(PyObject *__pyx_v_self); /*proto*/
4034 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(PyObject *__pyx_v_self) {
4035  int __pyx_r;
4036  __Pyx_RefNannyDeclarations
4037  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
4038  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4039 
4040  /* function exit code */
4041  __Pyx_RefNannyFinishContext();
4042  return __pyx_r;
4043 }
4044 
4045 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4046  int __pyx_r;
4047  __Pyx_TraceDeclarations
4048  __Pyx_RefNannyDeclarations
4049  int __pyx_lineno = 0;
4050  const char *__pyx_filename = NULL;
4051  int __pyx_clineno = 0;
4052  __Pyx_RefNannySetupContext("__del__", 0);
4053  __Pyx_TraceCall("__del__", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
4054  __Pyx_INCREF(Py_None);
4055  __Pyx_GIVEREF(Py_None);
4056  __Pyx_GOTREF(__pyx_v_self->BC_type);
4057  __Pyx_DECREF(__pyx_v_self->BC_type);
4058  __pyx_v_self->BC_type = ((PyObject*)Py_None);
4059 
4060  /* function exit code */
4061  __pyx_r = 0;
4062  goto __pyx_L0;
4063  __pyx_L1_error:;
4064  __Pyx_AddTraceback("BoundaryConditions.BC_Base.BC_type.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4065  __pyx_r = -1;
4066  __pyx_L0:;
4067  __Pyx_TraceReturn(Py_None, 0);
4068  __Pyx_RefNannyFinishContext();
4069  return __pyx_r;
4070 }
4071 
4072 /* "BoundaryConditions.pxd":12
4073  * str name
4074  * str BC_type
4075  * object ct # <<<<<<<<<<<<<<
4076  * # cpdef void newGlobalBC(BC_Base cls, newstr name, object default_value)
4077  * # cpdef void getContext(BC_Base cls, object context=*)
4078  */
4079 
4080 /* Python wrapper */
4081 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(PyObject *__pyx_v_self); /*proto*/
4082 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(PyObject *__pyx_v_self) {
4083  PyObject *__pyx_r = 0;
4084  __Pyx_RefNannyDeclarations
4085  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4086  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4087 
4088  /* function exit code */
4089  __Pyx_RefNannyFinishContext();
4090  return __pyx_r;
4091 }
4092 
4093 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4094  PyObject *__pyx_r = NULL;
4095  __Pyx_TraceDeclarations
4096  __Pyx_RefNannyDeclarations
4097  int __pyx_lineno = 0;
4098  const char *__pyx_filename = NULL;
4099  int __pyx_clineno = 0;
4100  __Pyx_RefNannySetupContext("__get__", 0);
4101  __Pyx_TraceCall("__get__", __pyx_f[2], 12, 0, __PYX_ERR(2, 12, __pyx_L1_error));
4102  __Pyx_XDECREF(__pyx_r);
4103  __Pyx_INCREF(__pyx_v_self->ct);
4104  __pyx_r = __pyx_v_self->ct;
4105  goto __pyx_L0;
4106 
4107  /* function exit code */
4108  __pyx_L1_error:;
4109  __Pyx_AddTraceback("BoundaryConditions.BC_Base.ct.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4110  __pyx_r = NULL;
4111  __pyx_L0:;
4112  __Pyx_XGIVEREF(__pyx_r);
4113  __Pyx_TraceReturn(__pyx_r, 0);
4114  __Pyx_RefNannyFinishContext();
4115  return __pyx_r;
4116 }
4117 
4118 /* Python wrapper */
4119 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
4120 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4121  int __pyx_r;
4122  __Pyx_RefNannyDeclarations
4123  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
4124  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4125 
4126  /* function exit code */
4127  __Pyx_RefNannyFinishContext();
4128  return __pyx_r;
4129 }
4130 
4131 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
4132  int __pyx_r;
4133  __Pyx_TraceDeclarations
4134  __Pyx_RefNannyDeclarations
4135  int __pyx_lineno = 0;
4136  const char *__pyx_filename = NULL;
4137  int __pyx_clineno = 0;
4138  __Pyx_RefNannySetupContext("__set__", 0);
4139  __Pyx_TraceCall("__set__", __pyx_f[2], 12, 0, __PYX_ERR(2, 12, __pyx_L1_error));
4140  __Pyx_INCREF(__pyx_v_value);
4141  __Pyx_GIVEREF(__pyx_v_value);
4142  __Pyx_GOTREF(__pyx_v_self->ct);
4143  __Pyx_DECREF(__pyx_v_self->ct);
4144  __pyx_v_self->ct = __pyx_v_value;
4145 
4146  /* function exit code */
4147  __pyx_r = 0;
4148  goto __pyx_L0;
4149  __pyx_L1_error:;
4150  __Pyx_AddTraceback("BoundaryConditions.BC_Base.ct.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4151  __pyx_r = -1;
4152  __pyx_L0:;
4153  __Pyx_TraceReturn(Py_None, 0);
4154  __Pyx_RefNannyFinishContext();
4155  return __pyx_r;
4156 }
4157 
4158 /* Python wrapper */
4159 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(PyObject *__pyx_v_self); /*proto*/
4160 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(PyObject *__pyx_v_self) {
4161  int __pyx_r;
4162  __Pyx_RefNannyDeclarations
4163  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
4164  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4165 
4166  /* function exit code */
4167  __Pyx_RefNannyFinishContext();
4168  return __pyx_r;
4169 }
4170 
4171 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4172  int __pyx_r;
4173  __Pyx_TraceDeclarations
4174  __Pyx_RefNannyDeclarations
4175  int __pyx_lineno = 0;
4176  const char *__pyx_filename = NULL;
4177  int __pyx_clineno = 0;
4178  __Pyx_RefNannySetupContext("__del__", 0);
4179  __Pyx_TraceCall("__del__", __pyx_f[2], 12, 0, __PYX_ERR(2, 12, __pyx_L1_error));
4180  __Pyx_INCREF(Py_None);
4181  __Pyx_GIVEREF(Py_None);
4182  __Pyx_GOTREF(__pyx_v_self->ct);
4183  __Pyx_DECREF(__pyx_v_self->ct);
4184  __pyx_v_self->ct = Py_None;
4185 
4186  /* function exit code */
4187  __pyx_r = 0;
4188  goto __pyx_L0;
4189  __pyx_L1_error:;
4190  __Pyx_AddTraceback("BoundaryConditions.BC_Base.ct.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4191  __pyx_r = -1;
4192  __pyx_L0:;
4193  __Pyx_TraceReturn(Py_None, 0);
4194  __Pyx_RefNannyFinishContext();
4195  return __pyx_r;
4196 }
4197 
4198 /* "(tree fragment)":1
4199  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4200  * cdef tuple state
4201  * cdef object _dict
4202  */
4203 
4204 /* Python wrapper */
4205 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4206 static char __pyx_doc_18BoundaryConditions_7BC_Base_4__reduce_cython__[] = "BC_Base.__reduce_cython__(self)";
4207 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_7BC_Base_4__reduce_cython__};
4208 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4209  PyObject *__pyx_r = 0;
4210  __Pyx_RefNannyDeclarations
4211  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
4212  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4213 
4214  /* function exit code */
4215  __Pyx_RefNannyFinishContext();
4216  return __pyx_r;
4217 }
4218 
4219 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4220  PyObject *__pyx_v_state = 0;
4221  PyObject *__pyx_v__dict = 0;
4222  int __pyx_v_use_setstate;
4223  PyObject *__pyx_r = NULL;
4224  __Pyx_TraceDeclarations
4225  __Pyx_RefNannyDeclarations
4226  PyObject *__pyx_t_1 = NULL;
4227  PyObject *__pyx_t_2 = NULL;
4228  PyObject *__pyx_t_3 = NULL;
4229  int __pyx_t_4;
4230  int __pyx_t_5;
4231  int __pyx_t_6;
4232  int __pyx_lineno = 0;
4233  const char *__pyx_filename = NULL;
4234  int __pyx_clineno = 0;
4235  __Pyx_TraceFrameInit(__pyx_codeobj__2)
4236  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
4237  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
4238 
4239  /* "(tree fragment)":5
4240  * cdef object _dict
4241  * cdef bint use_setstate
4242  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd) # <<<<<<<<<<<<<<
4243  * _dict = getattr(self, '__dict__', None)
4244  * if _dict is not None:
4245  */
4246  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->_b_or, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
4247  __Pyx_GOTREF(__pyx_t_1);
4248  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nd); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
4249  __Pyx_GOTREF(__pyx_t_2);
4250  __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
4251  __Pyx_GOTREF(__pyx_t_3);
4252  __Pyx_INCREF(__pyx_v_self->BC_type);
4253  __Pyx_GIVEREF(__pyx_v_self->BC_type);
4254  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->BC_type);
4255  __Pyx_INCREF(__pyx_v_self->Shape);
4256  __Pyx_GIVEREF(__pyx_v_self->Shape);
4257  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->Shape);
4258  __Pyx_GIVEREF(__pyx_t_1);
4259  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
4260  __Pyx_INCREF(__pyx_v_self->ct);
4261  __Pyx_GIVEREF(__pyx_v_self->ct);
4262  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_self->ct);
4263  __Pyx_INCREF(__pyx_v_self->name);
4264  __Pyx_GIVEREF(__pyx_v_self->name);
4265  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_self->name);
4266  __Pyx_GIVEREF(__pyx_t_2);
4267  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_2);
4268  __pyx_t_1 = 0;
4269  __pyx_t_2 = 0;
4270  __pyx_v_state = ((PyObject*)__pyx_t_3);
4271  __pyx_t_3 = 0;
4272 
4273  /* "(tree fragment)":6
4274  * cdef bint use_setstate
4275  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
4276  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
4277  * if _dict is not None:
4278  * state += (_dict,)
4279  */
4280  __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
4281  __Pyx_GOTREF(__pyx_t_3);
4282  __pyx_v__dict = __pyx_t_3;
4283  __pyx_t_3 = 0;
4284 
4285  /* "(tree fragment)":7
4286  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
4287  * _dict = getattr(self, '__dict__', None)
4288  * if _dict is not None: # <<<<<<<<<<<<<<
4289  * state += (_dict,)
4290  * use_setstate = True
4291  */
4292  __pyx_t_4 = (__pyx_v__dict != Py_None);
4293  __pyx_t_5 = (__pyx_t_4 != 0);
4294  if (__pyx_t_5) {
4295 
4296  /* "(tree fragment)":8
4297  * _dict = getattr(self, '__dict__', None)
4298  * if _dict is not None:
4299  * state += (_dict,) # <<<<<<<<<<<<<<
4300  * use_setstate = True
4301  * else:
4302  */
4303  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
4304  __Pyx_GOTREF(__pyx_t_3);
4305  __Pyx_INCREF(__pyx_v__dict);
4306  __Pyx_GIVEREF(__pyx_v__dict);
4307  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict);
4308  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error)
4309  __Pyx_GOTREF(__pyx_t_2);
4310  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4311  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
4312  __pyx_t_2 = 0;
4313 
4314  /* "(tree fragment)":9
4315  * if _dict is not None:
4316  * state += (_dict,)
4317  * use_setstate = True # <<<<<<<<<<<<<<
4318  * else:
4319  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None
4320  */
4321  __pyx_v_use_setstate = 1;
4322 
4323  /* "(tree fragment)":7
4324  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
4325  * _dict = getattr(self, '__dict__', None)
4326  * if _dict is not None: # <<<<<<<<<<<<<<
4327  * state += (_dict,)
4328  * use_setstate = True
4329  */
4330  goto __pyx_L3;
4331  }
4332 
4333  /* "(tree fragment)":11
4334  * use_setstate = True
4335  * else:
4336  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None # <<<<<<<<<<<<<<
4337  * if use_setstate:
4338  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state
4339  */
4340  /*else*/ {
4341  __pyx_t_4 = (__pyx_v_self->BC_type != ((PyObject*)Py_None));
4342  __pyx_t_6 = (__pyx_t_4 != 0);
4343  if (!__pyx_t_6) {
4344  } else {
4345  __pyx_t_5 = __pyx_t_6;
4346  goto __pyx_L4_bool_binop_done;
4347  }
4348  __pyx_t_6 = (__pyx_v_self->Shape != Py_None);
4349  __pyx_t_4 = (__pyx_t_6 != 0);
4350  if (!__pyx_t_4) {
4351  } else {
4352  __pyx_t_5 = __pyx_t_4;
4353  goto __pyx_L4_bool_binop_done;
4354  }
4355  __pyx_t_4 = (__pyx_v_self->ct != Py_None);
4356  __pyx_t_6 = (__pyx_t_4 != 0);
4357  if (!__pyx_t_6) {
4358  } else {
4359  __pyx_t_5 = __pyx_t_6;
4360  goto __pyx_L4_bool_binop_done;
4361  }
4362  __pyx_t_6 = (__pyx_v_self->name != ((PyObject*)Py_None));
4363  __pyx_t_4 = (__pyx_t_6 != 0);
4364  __pyx_t_5 = __pyx_t_4;
4365  __pyx_L4_bool_binop_done:;
4366  __pyx_v_use_setstate = __pyx_t_5;
4367  }
4368  __pyx_L3:;
4369 
4370  /* "(tree fragment)":12
4371  * else:
4372  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None
4373  * if use_setstate: # <<<<<<<<<<<<<<
4374  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state
4375  * else:
4376  */
4377  __pyx_t_5 = (__pyx_v_use_setstate != 0);
4378  if (__pyx_t_5) {
4379 
4380  /* "(tree fragment)":13
4381  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None
4382  * if use_setstate:
4383  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state # <<<<<<<<<<<<<<
4384  * else:
4385  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
4386  */
4387  __Pyx_XDECREF(__pyx_r);
4388  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_BC_Base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
4389  __Pyx_GOTREF(__pyx_t_2);
4390  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
4391  __Pyx_GOTREF(__pyx_t_3);
4392  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4393  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4394  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4395  __Pyx_INCREF(__pyx_int_158231071);
4396  __Pyx_GIVEREF(__pyx_int_158231071);
4397  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_158231071);
4398  __Pyx_INCREF(Py_None);
4399  __Pyx_GIVEREF(Py_None);
4400  PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None);
4401  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
4402  __Pyx_GOTREF(__pyx_t_1);
4403  __Pyx_GIVEREF(__pyx_t_2);
4404  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
4405  __Pyx_GIVEREF(__pyx_t_3);
4406  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
4407  __Pyx_INCREF(__pyx_v_state);
4408  __Pyx_GIVEREF(__pyx_v_state);
4409  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
4410  __pyx_t_2 = 0;
4411  __pyx_t_3 = 0;
4412  __pyx_r = __pyx_t_1;
4413  __pyx_t_1 = 0;
4414  goto __pyx_L0;
4415 
4416  /* "(tree fragment)":12
4417  * else:
4418  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None
4419  * if use_setstate: # <<<<<<<<<<<<<<
4420  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state
4421  * else:
4422  */
4423  }
4424 
4425  /* "(tree fragment)":15
4426  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state
4427  * else:
4428  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state) # <<<<<<<<<<<<<<
4429  * def __setstate_cython__(self, __pyx_state):
4430  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
4431  */
4432  /*else*/ {
4433  __Pyx_XDECREF(__pyx_r);
4434  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_BC_Base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
4435  __Pyx_GOTREF(__pyx_t_1);
4436  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
4437  __Pyx_GOTREF(__pyx_t_3);
4438  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4439  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4440  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4441  __Pyx_INCREF(__pyx_int_158231071);
4442  __Pyx_GIVEREF(__pyx_int_158231071);
4443  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_158231071);
4444  __Pyx_INCREF(__pyx_v_state);
4445  __Pyx_GIVEREF(__pyx_v_state);
4446  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
4447  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
4448  __Pyx_GOTREF(__pyx_t_2);
4449  __Pyx_GIVEREF(__pyx_t_1);
4450  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4451  __Pyx_GIVEREF(__pyx_t_3);
4452  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
4453  __pyx_t_1 = 0;
4454  __pyx_t_3 = 0;
4455  __pyx_r = __pyx_t_2;
4456  __pyx_t_2 = 0;
4457  goto __pyx_L0;
4458  }
4459 
4460  /* "(tree fragment)":1
4461  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4462  * cdef tuple state
4463  * cdef object _dict
4464  */
4465 
4466  /* function exit code */
4467  __pyx_L1_error:;
4468  __Pyx_XDECREF(__pyx_t_1);
4469  __Pyx_XDECREF(__pyx_t_2);
4470  __Pyx_XDECREF(__pyx_t_3);
4471  __Pyx_AddTraceback("BoundaryConditions.BC_Base.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4472  __pyx_r = NULL;
4473  __pyx_L0:;
4474  __Pyx_XDECREF(__pyx_v_state);
4475  __Pyx_XDECREF(__pyx_v__dict);
4476  __Pyx_XGIVEREF(__pyx_r);
4477  __Pyx_TraceReturn(__pyx_r, 0);
4478  __Pyx_RefNannyFinishContext();
4479  return __pyx_r;
4480 }
4481 
4482 /* "(tree fragment)":16
4483  * else:
4484  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
4485  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4486  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
4487  */
4488 
4489 /* Python wrapper */
4490 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
4491 static char __pyx_doc_18BoundaryConditions_7BC_Base_6__setstate_cython__[] = "BC_Base.__setstate_cython__(self, __pyx_state)";
4492 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_7BC_Base_6__setstate_cython__};
4493 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4494  PyObject *__pyx_r = 0;
4495  __Pyx_RefNannyDeclarations
4496  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
4497  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4498 
4499  /* function exit code */
4500  __Pyx_RefNannyFinishContext();
4501  return __pyx_r;
4502 }
4503 
4504 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4505  PyObject *__pyx_r = NULL;
4506  __Pyx_TraceDeclarations
4507  __Pyx_RefNannyDeclarations
4508  PyObject *__pyx_t_1 = NULL;
4509  int __pyx_lineno = 0;
4510  const char *__pyx_filename = NULL;
4511  int __pyx_clineno = 0;
4512  __Pyx_TraceFrameInit(__pyx_codeobj__3)
4513  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
4514  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
4515 
4516  /* "(tree fragment)":17
4517  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
4518  * def __setstate_cython__(self, __pyx_state):
4519  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
4520  */
4521  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
4522  __pyx_t_1 = __pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
4523  __Pyx_GOTREF(__pyx_t_1);
4524  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4525 
4526  /* "(tree fragment)":16
4527  * else:
4528  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
4529  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4530  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
4531  */
4532 
4533  /* function exit code */
4534  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4535  goto __pyx_L0;
4536  __pyx_L1_error:;
4537  __Pyx_XDECREF(__pyx_t_1);
4538  __Pyx_AddTraceback("BoundaryConditions.BC_Base.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4539  __pyx_r = NULL;
4540  __pyx_L0:;
4541  __Pyx_XGIVEREF(__pyx_r);
4542  __Pyx_TraceReturn(__pyx_r, 0);
4543  __Pyx_RefNannyFinishContext();
4544  return __pyx_r;
4545 }
4546 
4547 /* "BoundaryConditions.py":78
4548  * no boundary condition
4549  * """
4550  * def __init__(self): # <<<<<<<<<<<<<<
4551  * self.uOfXT = None
4552  *
4553  */
4554 
4555 /* Python wrapper */
4556 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4557 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4558  int __pyx_r;
4559  __Pyx_RefNannyDeclarations
4560  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
4561  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
4562  __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
4563  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
4564  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4565 
4566  /* function exit code */
4567  __Pyx_RefNannyFinishContext();
4568  return __pyx_r;
4569 }
4570 
4571 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4572  int __pyx_r;
4573  __Pyx_TraceDeclarations
4574  __Pyx_RefNannyDeclarations
4575  int __pyx_lineno = 0;
4576  const char *__pyx_filename = NULL;
4577  int __pyx_clineno = 0;
4578  __Pyx_RefNannySetupContext("__init__", 0);
4579  __Pyx_TraceCall("__init__", __pyx_f[0], 78, 0, __PYX_ERR(0, 78, __pyx_L1_error));
4580 
4581  /* "BoundaryConditions.py":79
4582  * """
4583  * def __init__(self):
4584  * self.uOfXT = None # <<<<<<<<<<<<<<
4585  *
4586  * def init_cython(self):
4587  */
4588  __Pyx_INCREF(Py_None);
4589  __Pyx_GIVEREF(Py_None);
4590  __Pyx_GOTREF(__pyx_v_self->uOfXT);
4591  __Pyx_DECREF(__pyx_v_self->uOfXT);
4592  __pyx_v_self->uOfXT = Py_None;
4593 
4594  /* "BoundaryConditions.py":78
4595  * no boundary condition
4596  * """
4597  * def __init__(self): # <<<<<<<<<<<<<<
4598  * self.uOfXT = None
4599  *
4600  */
4601 
4602  /* function exit code */
4603  __pyx_r = 0;
4604  goto __pyx_L0;
4605  __pyx_L1_error:;
4606  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4607  __pyx_r = -1;
4608  __pyx_L0:;
4609  __Pyx_TraceReturn(Py_None, 0);
4610  __Pyx_RefNannyFinishContext();
4611  return __pyx_r;
4612 }
4613 
4614 /* "BoundaryConditions.py":81
4615  * self.uOfXT = None
4616  *
4617  * def init_cython(self): # <<<<<<<<<<<<<<
4618  * return self.uOfXT
4619  *
4620  */
4621 
4622 /* Python wrapper */
4623 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4624 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_2init_cython[] = "BoundaryCondition.init_cython(self)";
4625 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_3init_cython = {"init_cython", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_2init_cython};
4626 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4627  PyObject *__pyx_r = 0;
4628  __Pyx_RefNannyDeclarations
4629  __Pyx_RefNannySetupContext("init_cython (wrapper)", 0);
4630  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4631 
4632  /* function exit code */
4633  __Pyx_RefNannyFinishContext();
4634  return __pyx_r;
4635 }
4636 
4637 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4638  PyObject *__pyx_r = NULL;
4639  __Pyx_TraceDeclarations
4640  __Pyx_RefNannyDeclarations
4641  int __pyx_lineno = 0;
4642  const char *__pyx_filename = NULL;
4643  int __pyx_clineno = 0;
4644  __Pyx_TraceFrameInit(__pyx_codeobj__4)
4645  __Pyx_RefNannySetupContext("init_cython", 0);
4646  __Pyx_TraceCall("init_cython", __pyx_f[0], 81, 0, __PYX_ERR(0, 81, __pyx_L1_error));
4647 
4648  /* "BoundaryConditions.py":82
4649  *
4650  * def init_cython(self):
4651  * return self.uOfXT # <<<<<<<<<<<<<<
4652  *
4653  * def resetBC(self):
4654  */
4655  __Pyx_XDECREF(__pyx_r);
4656  __Pyx_INCREF(__pyx_v_self->uOfXT);
4657  __pyx_r = __pyx_v_self->uOfXT;
4658  goto __pyx_L0;
4659 
4660  /* "BoundaryConditions.py":81
4661  * self.uOfXT = None
4662  *
4663  * def init_cython(self): # <<<<<<<<<<<<<<
4664  * return self.uOfXT
4665  *
4666  */
4667 
4668  /* function exit code */
4669  __pyx_L1_error:;
4670  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.init_cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
4671  __pyx_r = NULL;
4672  __pyx_L0:;
4673  __Pyx_XGIVEREF(__pyx_r);
4674  __Pyx_TraceReturn(__pyx_r, 0);
4675  __Pyx_RefNannyFinishContext();
4676  return __pyx_r;
4677 }
4678 
4679 /* "BoundaryConditions.py":84
4680  * return self.uOfXT
4681  *
4682  * def resetBC(self): # <<<<<<<<<<<<<<
4683  * self.uOfXT = None
4684  *
4685  */
4686 
4687 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4688 static void __pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, int __pyx_skip_dispatch) {
4689  __Pyx_TraceDeclarations
4690  __Pyx_RefNannyDeclarations
4691  PyObject *__pyx_t_1 = NULL;
4692  PyObject *__pyx_t_2 = NULL;
4693  PyObject *__pyx_t_3 = NULL;
4694  PyObject *__pyx_t_4 = NULL;
4695  int __pyx_lineno = 0;
4696  const char *__pyx_filename = NULL;
4697  int __pyx_clineno = 0;
4698  __Pyx_TraceFrameInit(__pyx_codeobj__5)
4699  __Pyx_RefNannySetupContext("resetBC", 0);
4700  __Pyx_TraceCall("resetBC", __pyx_f[0], 84, 0, __PYX_ERR(0, 84, __pyx_L1_error));
4701  /* Check if called by wrapper */
4702  if (unlikely(__pyx_skip_dispatch)) ;
4703  /* Check if overridden in Python */
4704  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
4705  #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4706  static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4707  if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
4708  PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4709  #endif
4710  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_resetBC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
4711  __Pyx_GOTREF(__pyx_t_1);
4712  if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC)) {
4713  __Pyx_INCREF(__pyx_t_1);
4714  __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
4715  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4716  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4717  if (likely(__pyx_t_4)) {
4718  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4719  __Pyx_INCREF(__pyx_t_4);
4720  __Pyx_INCREF(function);
4721  __Pyx_DECREF_SET(__pyx_t_3, function);
4722  }
4723  }
4724  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4725  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4726  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
4727  __Pyx_GOTREF(__pyx_t_2);
4728  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4729  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4730  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4731  goto __pyx_L0;
4732  }
4733  #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4734  __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4735  __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
4736  if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
4737  __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4738  }
4739  #endif
4740  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4741  #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4742  }
4743  #endif
4744  }
4745 
4746  /* "BoundaryConditions.py":85
4747  *
4748  * def resetBC(self):
4749  * self.uOfXT = None # <<<<<<<<<<<<<<
4750  *
4751  * def setConstantBC(self, value):
4752  */
4753  __Pyx_INCREF(Py_None);
4754  __Pyx_GIVEREF(Py_None);
4755  __Pyx_GOTREF(__pyx_v_self->uOfXT);
4756  __Pyx_DECREF(__pyx_v_self->uOfXT);
4757  __pyx_v_self->uOfXT = Py_None;
4758 
4759  /* "BoundaryConditions.py":84
4760  * return self.uOfXT
4761  *
4762  * def resetBC(self): # <<<<<<<<<<<<<<
4763  * self.uOfXT = None
4764  *
4765  */
4766 
4767  /* function exit code */
4768  goto __pyx_L0;
4769  __pyx_L1_error:;
4770  __Pyx_XDECREF(__pyx_t_1);
4771  __Pyx_XDECREF(__pyx_t_2);
4772  __Pyx_XDECREF(__pyx_t_3);
4773  __Pyx_XDECREF(__pyx_t_4);
4774  __Pyx_WriteUnraisable("BoundaryConditions.BoundaryCondition.resetBC", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4775  __pyx_L0:;
4776  __Pyx_TraceReturn(Py_None, 0);
4777  __Pyx_RefNannyFinishContext();
4778 }
4779 
4780 /* Python wrapper */
4781 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4782 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_4resetBC[] = "BoundaryCondition.resetBC(self) -> void";
4783 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_5resetBC = {"resetBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_4resetBC};
4784 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4785  PyObject *__pyx_r = 0;
4786  __Pyx_RefNannyDeclarations
4787  __Pyx_RefNannySetupContext("resetBC (wrapper)", 0);
4788  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4789 
4790  /* function exit code */
4791  __Pyx_RefNannyFinishContext();
4792  return __pyx_r;
4793 }
4794 
4795 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4796  PyObject *__pyx_r = NULL;
4797  __Pyx_TraceDeclarations
4798  __Pyx_RefNannyDeclarations
4799  PyObject *__pyx_t_1 = NULL;
4800  int __pyx_lineno = 0;
4801  const char *__pyx_filename = NULL;
4802  int __pyx_clineno = 0;
4803  __Pyx_TraceFrameInit(__pyx_codeobj__5)
4804  __Pyx_RefNannySetupContext("resetBC", 0);
4805  __Pyx_TraceCall("resetBC (wrapper)", __pyx_f[0], 84, 0, __PYX_ERR(0, 84, __pyx_L1_error));
4806  __Pyx_XDECREF(__pyx_r);
4807  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
4808  __Pyx_GOTREF(__pyx_t_1);
4809  __pyx_r = __pyx_t_1;
4810  __pyx_t_1 = 0;
4811  goto __pyx_L0;
4812 
4813  /* function exit code */
4814  __pyx_L1_error:;
4815  __Pyx_XDECREF(__pyx_t_1);
4816  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.resetBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4817  __pyx_r = NULL;
4818  __pyx_L0:;
4819  __Pyx_XGIVEREF(__pyx_r);
4820  __Pyx_TraceReturn(__pyx_r, 0);
4821  __Pyx_RefNannyFinishContext();
4822  return __pyx_r;
4823 }
4824 
4825 /* "BoundaryConditions.py":87
4826  * self.uOfXT = None
4827  *
4828  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
4829  * """
4830  * function returning constant BC
4831  */
4832 
4833 /* Python wrapper */
4834 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
4835 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC[] = "BoundaryCondition.setConstantBC(self, value)\n\n function returning constant BC\n\n Parameters\n ----------\n value : float\n Constant value\n\n ";
4836 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_7setConstantBC = {"setConstantBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC};
4837 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4838  PyObject *__pyx_r = 0;
4839  __Pyx_RefNannyDeclarations
4840  __Pyx_RefNannySetupContext("setConstantBC (wrapper)", 0);
4841  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4842 
4843  /* function exit code */
4844  __Pyx_RefNannyFinishContext();
4845  return __pyx_r;
4846 }
4847 
4848 /* "BoundaryConditions.py":97
4849  *
4850  * """
4851  * self.uOfXT = lambda x, t, n=np.zeros(3,): value # <<<<<<<<<<<<<<
4852  *
4853  *
4854  */
4855 
4856 static PyObject *__pyx_pf_18BoundaryConditions_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
4857  PyObject *__pyx_r = NULL;
4858  __Pyx_TraceDeclarations
4859  __Pyx_RefNannyDeclarations
4860  PyObject *__pyx_t_1 = NULL;
4861  PyObject *__pyx_t_2 = NULL;
4862  int __pyx_lineno = 0;
4863  const char *__pyx_filename = NULL;
4864  int __pyx_clineno = 0;
4865  __Pyx_RefNannySetupContext("__defaults__", 0);
4866  __Pyx_TraceCall("__defaults__", __pyx_f[0], 97, 0, __PYX_ERR(0, 97, __pyx_L1_error));
4867  __Pyx_XDECREF(__pyx_r);
4868  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
4869  __Pyx_GOTREF(__pyx_t_1);
4870  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_n);
4871  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_n);
4872  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_n);
4873  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
4874  __Pyx_GOTREF(__pyx_t_2);
4875  __Pyx_GIVEREF(__pyx_t_1);
4876  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4877  __Pyx_INCREF(Py_None);
4878  __Pyx_GIVEREF(Py_None);
4879  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
4880  __pyx_t_1 = 0;
4881  __pyx_r = __pyx_t_2;
4882  __pyx_t_2 = 0;
4883  goto __pyx_L0;
4884 
4885  /* function exit code */
4886  __pyx_L1_error:;
4887  __Pyx_XDECREF(__pyx_t_1);
4888  __Pyx_XDECREF(__pyx_t_2);
4889  __Pyx_AddTraceback("BoundaryConditions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4890  __pyx_r = NULL;
4891  __pyx_L0:;
4892  __Pyx_XGIVEREF(__pyx_r);
4893  __Pyx_TraceReturn(__pyx_r, 0);
4894  __Pyx_RefNannyFinishContext();
4895  return __pyx_r;
4896 }
4897 
4898 /* Python wrapper */
4899 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4900 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda = {"lambda", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda, METH_VARARGS|METH_KEYWORDS, 0};
4901 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4902  CYTHON_UNUSED PyObject *__pyx_v_x = 0;
4903  CYTHON_UNUSED PyObject *__pyx_v_t = 0;
4904  CYTHON_UNUSED PyObject *__pyx_v_n = 0;
4905  int __pyx_lineno = 0;
4906  const char *__pyx_filename = NULL;
4907  int __pyx_clineno = 0;
4908  PyObject *__pyx_r = 0;
4909  __Pyx_RefNannyDeclarations
4910  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
4911  {
4912  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_n,0};
4913  PyObject* values[3] = {0,0,0};
4914  __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
4915  values[2] = __pyx_dynamic_args->__pyx_arg_n;
4916  if (unlikely(__pyx_kwds)) {
4917  Py_ssize_t kw_args;
4918  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4919  switch (pos_args) {
4920  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4921  CYTHON_FALLTHROUGH;
4922  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4923  CYTHON_FALLTHROUGH;
4924  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4925  CYTHON_FALLTHROUGH;
4926  case 0: break;
4927  default: goto __pyx_L5_argtuple_error;
4928  }
4929  kw_args = PyDict_Size(__pyx_kwds);
4930  switch (pos_args) {
4931  case 0:
4932  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4933  else goto __pyx_L5_argtuple_error;
4934  CYTHON_FALLTHROUGH;
4935  case 1:
4936  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
4937  else {
4938  __Pyx_RaiseArgtupleInvalid("lambda", 0, 2, 3, 1); __PYX_ERR(0, 97, __pyx_L3_error)
4939  }
4940  CYTHON_FALLTHROUGH;
4941  case 2:
4942  if (kw_args > 0) {
4943  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
4944  if (value) { values[2] = value; kw_args--; }
4945  }
4946  }
4947  if (unlikely(kw_args > 0)) {
4948  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda") < 0)) __PYX_ERR(0, 97, __pyx_L3_error)
4949  }
4950  } else {
4951  switch (PyTuple_GET_SIZE(__pyx_args)) {
4952  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4953  CYTHON_FALLTHROUGH;
4954  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4955  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4956  break;
4957  default: goto __pyx_L5_argtuple_error;
4958  }
4959  }
4960  __pyx_v_x = values[0];
4961  __pyx_v_t = values[1];
4962  __pyx_v_n = values[2];
4963  }
4964  goto __pyx_L4_argument_unpacking_done;
4965  __pyx_L5_argtuple_error:;
4966  __Pyx_RaiseArgtupleInvalid("lambda", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 97, __pyx_L3_error)
4967  __pyx_L3_error:;
4968  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setConstantBC.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
4969  __Pyx_RefNannyFinishContext();
4970  return NULL;
4971  __pyx_L4_argument_unpacking_done:;
4972  __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_n);
4973 
4974  /* function exit code */
4975  __Pyx_RefNannyFinishContext();
4976  return __pyx_r;
4977 }
4978 
4979 static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n) {
4980  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_cur_scope;
4981  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_outer_scope;
4982  PyObject *__pyx_r = NULL;
4983  __Pyx_TraceDeclarations
4984  __Pyx_RefNannyDeclarations
4985  int __pyx_lineno = 0;
4986  const char *__pyx_filename = NULL;
4987  int __pyx_clineno = 0;
4988  __Pyx_RefNannySetupContext("lambda", 0);
4989  __pyx_outer_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *) __Pyx_CyFunction_GetClosure(__pyx_self);
4990  __pyx_cur_scope = __pyx_outer_scope;
4991  __Pyx_TraceCall("lambda", __pyx_f[0], 97, 0, __PYX_ERR(0, 97, __pyx_L1_error));
4992  __Pyx_XDECREF(__pyx_r);
4993  if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError("value"); __PYX_ERR(0, 97, __pyx_L1_error) }
4994  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
4995  __pyx_r = __pyx_cur_scope->__pyx_v_value;
4996  goto __pyx_L0;
4997 
4998  /* function exit code */
4999  __pyx_L1_error:;
5000  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setConstantBC.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
5001  __pyx_r = NULL;
5002  __pyx_L0:;
5003  __Pyx_XGIVEREF(__pyx_r);
5004  __Pyx_TraceReturn(__pyx_r, 0);
5005  __Pyx_RefNannyFinishContext();
5006  return __pyx_r;
5007 }
5008 
5009 /* "BoundaryConditions.py":87
5010  * self.uOfXT = None
5011  *
5012  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
5013  * """
5014  * function returning constant BC
5015  */
5016 
5017 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value) {
5018  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_cur_scope;
5019  PyObject *__pyx_r = NULL;
5020  __Pyx_TraceDeclarations
5021  __Pyx_RefNannyDeclarations
5022  PyObject *__pyx_t_1 = NULL;
5023  PyObject *__pyx_t_2 = NULL;
5024  PyObject *__pyx_t_3 = NULL;
5025  PyObject *__pyx_t_4 = NULL;
5026  int __pyx_lineno = 0;
5027  const char *__pyx_filename = NULL;
5028  int __pyx_clineno = 0;
5029  __Pyx_TraceFrameInit(__pyx_codeobj__6)
5030  __Pyx_RefNannySetupContext("setConstantBC", 0);
5031  __pyx_cur_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(__pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC, __pyx_empty_tuple, NULL);
5032  if (unlikely(!__pyx_cur_scope)) {
5033  __pyx_cur_scope = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)Py_None);
5034  __Pyx_INCREF(Py_None);
5035  __PYX_ERR(0, 87, __pyx_L1_error)
5036  } else {
5037  __Pyx_GOTREF(__pyx_cur_scope);
5038  }
5039  __Pyx_TraceCall("setConstantBC", __pyx_f[0], 87, 0, __PYX_ERR(0, 87, __pyx_L1_error));
5040  __pyx_cur_scope->__pyx_v_value = __pyx_v_value;
5041  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
5042  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
5043 
5044  /* "BoundaryConditions.py":97
5045  *
5046  * """
5047  * self.uOfXT = lambda x, t, n=np.zeros(3,): value # <<<<<<<<<<<<<<
5048  *
5049  *
5050  */
5051  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda, 0, __pyx_n_s_setConstantBC_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
5052  __Pyx_GOTREF(__pyx_t_1);
5053  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 97, __pyx_L1_error)
5054  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error)
5055  __Pyx_GOTREF(__pyx_t_3);
5056  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
5057  __Pyx_GOTREF(__pyx_t_4);
5058  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5059  __pyx_t_3 = NULL;
5060  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5061  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
5062  if (likely(__pyx_t_3)) {
5063  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5064  __Pyx_INCREF(__pyx_t_3);
5065  __Pyx_INCREF(function);
5066  __Pyx_DECREF_SET(__pyx_t_4, function);
5067  }
5068  }
5069  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
5070  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5071  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
5072  __Pyx_GOTREF(__pyx_t_2);
5073  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5074  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_1)->__pyx_arg_n = __pyx_t_2;
5075  __Pyx_GIVEREF(__pyx_t_2);
5076  __pyx_t_2 = 0;
5077  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_18BoundaryConditions_2__defaults__);
5078  __Pyx_GIVEREF(__pyx_t_1);
5079  __Pyx_GOTREF(__pyx_v_self->uOfXT);
5080  __Pyx_DECREF(__pyx_v_self->uOfXT);
5081  __pyx_v_self->uOfXT = __pyx_t_1;
5082  __pyx_t_1 = 0;
5083 
5084  /* "BoundaryConditions.py":87
5085  * self.uOfXT = None
5086  *
5087  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
5088  * """
5089  * function returning constant BC
5090  */
5091 
5092  /* function exit code */
5093  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5094  goto __pyx_L0;
5095  __pyx_L1_error:;
5096  __Pyx_XDECREF(__pyx_t_1);
5097  __Pyx_XDECREF(__pyx_t_2);
5098  __Pyx_XDECREF(__pyx_t_3);
5099  __Pyx_XDECREF(__pyx_t_4);
5100  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setConstantBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
5101  __pyx_r = NULL;
5102  __pyx_L0:;
5103  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5104  __Pyx_XGIVEREF(__pyx_r);
5105  __Pyx_TraceReturn(__pyx_r, 0);
5106  __Pyx_RefNannyFinishContext();
5107  return __pyx_r;
5108 }
5109 
5110 /* "BoundaryConditions.py":100
5111  *
5112  *
5113  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
5114  * """
5115  * function returning value=a0+ax*x+ay*y+az*z
5116  */
5117 
5118 /* Python wrapper */
5119 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5120 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC[] = "BoundaryCondition.setLinearBC(self, a0, a)\n\n function returning value=a0+ax*x+ay*y+az*z\n\n Parameters\n ----------\n a0 : float\n constant\n a: numpy.ndarray\n ax,ay,az\n\n ";
5121 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_9setLinearBC = {"setLinearBC", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC};
5122 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5123  PyObject *__pyx_v_a0 = 0;
5124  PyObject *__pyx_v_a = 0;
5125  int __pyx_lineno = 0;
5126  const char *__pyx_filename = NULL;
5127  int __pyx_clineno = 0;
5128  PyObject *__pyx_r = 0;
5129  __Pyx_RefNannyDeclarations
5130  __Pyx_RefNannySetupContext("setLinearBC (wrapper)", 0);
5131  {
5132  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a0,&__pyx_n_s_a,0};
5133  PyObject* values[2] = {0,0};
5134  if (unlikely(__pyx_kwds)) {
5135  Py_ssize_t kw_args;
5136  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5137  switch (pos_args) {
5138  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5139  CYTHON_FALLTHROUGH;
5140  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5141  CYTHON_FALLTHROUGH;
5142  case 0: break;
5143  default: goto __pyx_L5_argtuple_error;
5144  }
5145  kw_args = PyDict_Size(__pyx_kwds);
5146  switch (pos_args) {
5147  case 0:
5148  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a0)) != 0)) kw_args--;
5149  else goto __pyx_L5_argtuple_error;
5150  CYTHON_FALLTHROUGH;
5151  case 1:
5152  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
5153  else {
5154  __Pyx_RaiseArgtupleInvalid("setLinearBC", 1, 2, 2, 1); __PYX_ERR(0, 100, __pyx_L3_error)
5155  }
5156  }
5157  if (unlikely(kw_args > 0)) {
5158  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLinearBC") < 0)) __PYX_ERR(0, 100, __pyx_L3_error)
5159  }
5160  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5161  goto __pyx_L5_argtuple_error;
5162  } else {
5163  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5164  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5165  }
5166  __pyx_v_a0 = values[0];
5167  __pyx_v_a = values[1];
5168  }
5169  goto __pyx_L4_argument_unpacking_done;
5170  __pyx_L5_argtuple_error:;
5171  __Pyx_RaiseArgtupleInvalid("setLinearBC", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 100, __pyx_L3_error)
5172  __pyx_L3_error:;
5173  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
5174  __Pyx_RefNannyFinishContext();
5175  return NULL;
5176  __pyx_L4_argument_unpacking_done:;
5177  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), __pyx_v_a0, __pyx_v_a);
5178 
5179  /* function exit code */
5180  __Pyx_RefNannyFinishContext();
5181  return __pyx_r;
5182 }
5183 
5184 /* "BoundaryConditions.py":113
5185  * """
5186  *
5187  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:]) # <<<<<<<<<<<<<<
5188  *
5189  * def setLinearRamp(self,t1,value):
5190  */
5191 
5192 static PyObject *__pyx_pf_18BoundaryConditions_4__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
5193  PyObject *__pyx_r = NULL;
5194  __Pyx_TraceDeclarations
5195  __Pyx_RefNannyDeclarations
5196  PyObject *__pyx_t_1 = NULL;
5197  PyObject *__pyx_t_2 = NULL;
5198  int __pyx_lineno = 0;
5199  const char *__pyx_filename = NULL;
5200  int __pyx_clineno = 0;
5201  __Pyx_RefNannySetupContext("__defaults__", 0);
5202  __Pyx_TraceCall("__defaults__", __pyx_f[0], 113, 0, __PYX_ERR(0, 113, __pyx_L1_error));
5203  __Pyx_XDECREF(__pyx_r);
5204  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5205  __Pyx_GOTREF(__pyx_t_1);
5206  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_n);
5207  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_n);
5208  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_n);
5209  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5210  __Pyx_GOTREF(__pyx_t_2);
5211  __Pyx_GIVEREF(__pyx_t_1);
5212  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
5213  __Pyx_INCREF(Py_None);
5214  __Pyx_GIVEREF(Py_None);
5215  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
5216  __pyx_t_1 = 0;
5217  __pyx_r = __pyx_t_2;
5218  __pyx_t_2 = 0;
5219  goto __pyx_L0;
5220 
5221  /* function exit code */
5222  __pyx_L1_error:;
5223  __Pyx_XDECREF(__pyx_t_1);
5224  __Pyx_XDECREF(__pyx_t_2);
5225  __Pyx_AddTraceback("BoundaryConditions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5226  __pyx_r = NULL;
5227  __pyx_L0:;
5228  __Pyx_XGIVEREF(__pyx_r);
5229  __Pyx_TraceReturn(__pyx_r, 0);
5230  __Pyx_RefNannyFinishContext();
5231  return __pyx_r;
5232 }
5233 
5234 /* Python wrapper */
5235 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5236 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1 = {"lambda1", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1, METH_VARARGS|METH_KEYWORDS, 0};
5237 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5238  PyObject *__pyx_v_x = 0;
5239  CYTHON_UNUSED PyObject *__pyx_v_t = 0;
5240  CYTHON_UNUSED PyObject *__pyx_v_n = 0;
5241  int __pyx_lineno = 0;
5242  const char *__pyx_filename = NULL;
5243  int __pyx_clineno = 0;
5244  PyObject *__pyx_r = 0;
5245  __Pyx_RefNannyDeclarations
5246  __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
5247  {
5248  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_n,0};
5249  PyObject* values[3] = {0,0,0};
5250  __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self);
5251  values[2] = __pyx_dynamic_args->__pyx_arg_n;
5252  if (unlikely(__pyx_kwds)) {
5253  Py_ssize_t kw_args;
5254  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5255  switch (pos_args) {
5256  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5257  CYTHON_FALLTHROUGH;
5258  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5259  CYTHON_FALLTHROUGH;
5260  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5261  CYTHON_FALLTHROUGH;
5262  case 0: break;
5263  default: goto __pyx_L5_argtuple_error;
5264  }
5265  kw_args = PyDict_Size(__pyx_kwds);
5266  switch (pos_args) {
5267  case 0:
5268  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5269  else goto __pyx_L5_argtuple_error;
5270  CYTHON_FALLTHROUGH;
5271  case 1:
5272  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5273  else {
5274  __Pyx_RaiseArgtupleInvalid("lambda1", 0, 2, 3, 1); __PYX_ERR(0, 113, __pyx_L3_error)
5275  }
5276  CYTHON_FALLTHROUGH;
5277  case 2:
5278  if (kw_args > 0) {
5279  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
5280  if (value) { values[2] = value; kw_args--; }
5281  }
5282  }
5283  if (unlikely(kw_args > 0)) {
5284  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda1") < 0)) __PYX_ERR(0, 113, __pyx_L3_error)
5285  }
5286  } else {
5287  switch (PyTuple_GET_SIZE(__pyx_args)) {
5288  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5289  CYTHON_FALLTHROUGH;
5290  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5291  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5292  break;
5293  default: goto __pyx_L5_argtuple_error;
5294  }
5295  }
5296  __pyx_v_x = values[0];
5297  __pyx_v_t = values[1];
5298  __pyx_v_n = values[2];
5299  }
5300  goto __pyx_L4_argument_unpacking_done;
5301  __pyx_L5_argtuple_error:;
5302  __Pyx_RaiseArgtupleInvalid("lambda1", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 113, __pyx_L3_error)
5303  __pyx_L3_error:;
5304  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearBC.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
5305  __Pyx_RefNannyFinishContext();
5306  return NULL;
5307  __pyx_L4_argument_unpacking_done:;
5308  __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_n);
5309 
5310  /* function exit code */
5311  __Pyx_RefNannyFinishContext();
5312  return __pyx_r;
5313 }
5314 
5315 static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n) {
5316  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_cur_scope;
5317  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_outer_scope;
5318  PyObject *__pyx_r = NULL;
5319  __Pyx_TraceDeclarations
5320  __Pyx_RefNannyDeclarations
5321  PyObject *__pyx_t_1 = NULL;
5322  PyObject *__pyx_t_2 = NULL;
5323  PyObject *__pyx_t_3 = NULL;
5324  int __pyx_lineno = 0;
5325  const char *__pyx_filename = NULL;
5326  int __pyx_clineno = 0;
5327  __Pyx_RefNannySetupContext("lambda1", 0);
5328  __pyx_outer_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *) __Pyx_CyFunction_GetClosure(__pyx_self);
5329  __pyx_cur_scope = __pyx_outer_scope;
5330  __Pyx_TraceCall("lambda1", __pyx_f[0], 113, 0, __PYX_ERR(0, 113, __pyx_L1_error));
5331  __Pyx_XDECREF(__pyx_r);
5332  if (unlikely(!__pyx_cur_scope->__pyx_v_a0)) { __Pyx_RaiseClosureNameError("a0"); __PYX_ERR(0, 113, __pyx_L1_error) }
5333  if (unlikely(!__pyx_cur_scope->__pyx_v_a)) { __Pyx_RaiseClosureNameError("a"); __PYX_ERR(0, 113, __pyx_L1_error) }
5334  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_a, 0, 0, NULL, NULL, &__pyx_slice__7, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5335  __Pyx_GOTREF(__pyx_t_1);
5336  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_x, 0, 0, NULL, NULL, &__pyx_slice__7, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5337  __Pyx_GOTREF(__pyx_t_2);
5338  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
5339  __Pyx_GOTREF(__pyx_t_3);
5340  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5341  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5342  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5343  __Pyx_GOTREF(__pyx_t_2);
5344  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5345  __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_a0, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
5346  __Pyx_GOTREF(__pyx_t_3);
5347  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5348  __pyx_r = __pyx_t_3;
5349  __pyx_t_3 = 0;
5350  goto __pyx_L0;
5351 
5352  /* function exit code */
5353  __pyx_L1_error:;
5354  __Pyx_XDECREF(__pyx_t_1);
5355  __Pyx_XDECREF(__pyx_t_2);
5356  __Pyx_XDECREF(__pyx_t_3);
5357  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearBC.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
5358  __pyx_r = NULL;
5359  __pyx_L0:;
5360  __Pyx_XGIVEREF(__pyx_r);
5361  __Pyx_TraceReturn(__pyx_r, 0);
5362  __Pyx_RefNannyFinishContext();
5363  return __pyx_r;
5364 }
5365 
5366 /* "BoundaryConditions.py":100
5367  *
5368  *
5369  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
5370  * """
5371  * function returning value=a0+ax*x+ay*y+az*z
5372  */
5373 
5374 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_a0, PyObject *__pyx_v_a) {
5375  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_cur_scope;
5376  PyObject *__pyx_r = NULL;
5377  __Pyx_TraceDeclarations
5378  __Pyx_RefNannyDeclarations
5379  PyObject *__pyx_t_1 = NULL;
5380  PyObject *__pyx_t_2 = NULL;
5381  PyObject *__pyx_t_3 = NULL;
5382  PyObject *__pyx_t_4 = NULL;
5383  int __pyx_lineno = 0;
5384  const char *__pyx_filename = NULL;
5385  int __pyx_clineno = 0;
5386  __Pyx_TraceFrameInit(__pyx_codeobj__8)
5387  __Pyx_RefNannySetupContext("setLinearBC", 0);
5388  __pyx_cur_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(__pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, __pyx_empty_tuple, NULL);
5389  if (unlikely(!__pyx_cur_scope)) {
5390  __pyx_cur_scope = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)Py_None);
5391  __Pyx_INCREF(Py_None);
5392  __PYX_ERR(0, 100, __pyx_L1_error)
5393  } else {
5394  __Pyx_GOTREF(__pyx_cur_scope);
5395  }
5396  __Pyx_TraceCall("setLinearBC", __pyx_f[0], 100, 0, __PYX_ERR(0, 100, __pyx_L1_error));
5397  __pyx_cur_scope->__pyx_v_a0 = __pyx_v_a0;
5398  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a0);
5399  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a0);
5400  __pyx_cur_scope->__pyx_v_a = __pyx_v_a;
5401  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a);
5402  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a);
5403 
5404  /* "BoundaryConditions.py":113
5405  * """
5406  *
5407  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:]) # <<<<<<<<<<<<<<
5408  *
5409  * def setLinearRamp(self,t1,value):
5410  */
5411  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1, 0, __pyx_n_s_setLinearBC_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5412  __Pyx_GOTREF(__pyx_t_1);
5413  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 113, __pyx_L1_error)
5414  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
5415  __Pyx_GOTREF(__pyx_t_3);
5416  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L1_error)
5417  __Pyx_GOTREF(__pyx_t_4);
5418  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5419  __pyx_t_3 = NULL;
5420  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5421  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
5422  if (likely(__pyx_t_3)) {
5423  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5424  __Pyx_INCREF(__pyx_t_3);
5425  __Pyx_INCREF(function);
5426  __Pyx_DECREF_SET(__pyx_t_4, function);
5427  }
5428  }
5429  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
5430  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5431  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5432  __Pyx_GOTREF(__pyx_t_2);
5433  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5434  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_1)->__pyx_arg_n = __pyx_t_2;
5435  __Pyx_GIVEREF(__pyx_t_2);
5436  __pyx_t_2 = 0;
5437  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_18BoundaryConditions_4__defaults__);
5438  __Pyx_GIVEREF(__pyx_t_1);
5439  __Pyx_GOTREF(__pyx_v_self->uOfXT);
5440  __Pyx_DECREF(__pyx_v_self->uOfXT);
5441  __pyx_v_self->uOfXT = __pyx_t_1;
5442  __pyx_t_1 = 0;
5443 
5444  /* "BoundaryConditions.py":100
5445  *
5446  *
5447  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
5448  * """
5449  * function returning value=a0+ax*x+ay*y+az*z
5450  */
5451 
5452  /* function exit code */
5453  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5454  goto __pyx_L0;
5455  __pyx_L1_error:;
5456  __Pyx_XDECREF(__pyx_t_1);
5457  __Pyx_XDECREF(__pyx_t_2);
5458  __Pyx_XDECREF(__pyx_t_3);
5459  __Pyx_XDECREF(__pyx_t_4);
5460  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
5461  __pyx_r = NULL;
5462  __pyx_L0:;
5463  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5464  __Pyx_XGIVEREF(__pyx_r);
5465  __Pyx_TraceReturn(__pyx_r, 0);
5466  __Pyx_RefNannyFinishContext();
5467  return __pyx_r;
5468 }
5469 
5470 /* "BoundaryConditions.py":115
5471  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:])
5472  *
5473  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
5474  * """
5475  * function setting a linear ramp from t=0 to t=t1
5476  */
5477 
5478 /* Python wrapper */
5479 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5480 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp[] = "BoundaryCondition.setLinearRamp(self, t1, value)\n\n function setting a linear ramp from t=0 to t=t1\n\n Parameters\n -----------\n t1: float\n Ramp end time\n value: float\n Variable value\n ";
5481 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearRamp = {"setLinearRamp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp};
5482 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5483  PyObject *__pyx_v_t1 = 0;
5484  PyObject *__pyx_v_value = 0;
5485  int __pyx_lineno = 0;
5486  const char *__pyx_filename = NULL;
5487  int __pyx_clineno = 0;
5488  PyObject *__pyx_r = 0;
5489  __Pyx_RefNannyDeclarations
5490  __Pyx_RefNannySetupContext("setLinearRamp (wrapper)", 0);
5491  {
5492  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t1,&__pyx_n_s_value,0};
5493  PyObject* values[2] = {0,0};
5494  if (unlikely(__pyx_kwds)) {
5495  Py_ssize_t kw_args;
5496  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5497  switch (pos_args) {
5498  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5499  CYTHON_FALLTHROUGH;
5500  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5501  CYTHON_FALLTHROUGH;
5502  case 0: break;
5503  default: goto __pyx_L5_argtuple_error;
5504  }
5505  kw_args = PyDict_Size(__pyx_kwds);
5506  switch (pos_args) {
5507  case 0:
5508  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t1)) != 0)) kw_args--;
5509  else goto __pyx_L5_argtuple_error;
5510  CYTHON_FALLTHROUGH;
5511  case 1:
5512  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
5513  else {
5514  __Pyx_RaiseArgtupleInvalid("setLinearRamp", 1, 2, 2, 1); __PYX_ERR(0, 115, __pyx_L3_error)
5515  }
5516  }
5517  if (unlikely(kw_args > 0)) {
5518  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLinearRamp") < 0)) __PYX_ERR(0, 115, __pyx_L3_error)
5519  }
5520  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5521  goto __pyx_L5_argtuple_error;
5522  } else {
5523  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5524  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5525  }
5526  __pyx_v_t1 = values[0];
5527  __pyx_v_value = values[1];
5528  }
5529  goto __pyx_L4_argument_unpacking_done;
5530  __pyx_L5_argtuple_error:;
5531  __Pyx_RaiseArgtupleInvalid("setLinearRamp", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 115, __pyx_L3_error)
5532  __pyx_L3_error:;
5533  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearRamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
5534  __Pyx_RefNannyFinishContext();
5535  return NULL;
5536  __pyx_L4_argument_unpacking_done:;
5537  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), __pyx_v_t1, __pyx_v_value);
5538 
5539  /* function exit code */
5540  __Pyx_RefNannyFinishContext();
5541  return __pyx_r;
5542 }
5543 
5544 /* "BoundaryConditions.py":126
5545  * Variable value
5546  * """
5547  * self.uOfXT = lambda x, t, n=np.zeros(3,): min( t/t1, 1)*value # <<<<<<<<<<<<<<
5548  */
5549 
5550 static PyObject *__pyx_pf_18BoundaryConditions_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
5551  PyObject *__pyx_r = NULL;
5552  __Pyx_TraceDeclarations
5553  __Pyx_RefNannyDeclarations
5554  PyObject *__pyx_t_1 = NULL;
5555  PyObject *__pyx_t_2 = NULL;
5556  int __pyx_lineno = 0;
5557  const char *__pyx_filename = NULL;
5558  int __pyx_clineno = 0;
5559  __Pyx_RefNannySetupContext("__defaults__", 0);
5560  __Pyx_TraceCall("__defaults__", __pyx_f[0], 126, 0, __PYX_ERR(0, 126, __pyx_L1_error));
5561  __Pyx_XDECREF(__pyx_r);
5562  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
5563  __Pyx_GOTREF(__pyx_t_1);
5564  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_n);
5565  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_n);
5566  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_n);
5567  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5568  __Pyx_GOTREF(__pyx_t_2);
5569  __Pyx_GIVEREF(__pyx_t_1);
5570  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
5571  __Pyx_INCREF(Py_None);
5572  __Pyx_GIVEREF(Py_None);
5573  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
5574  __pyx_t_1 = 0;
5575  __pyx_r = __pyx_t_2;
5576  __pyx_t_2 = 0;
5577  goto __pyx_L0;
5578 
5579  /* function exit code */
5580  __pyx_L1_error:;
5581  __Pyx_XDECREF(__pyx_t_1);
5582  __Pyx_XDECREF(__pyx_t_2);
5583  __Pyx_AddTraceback("BoundaryConditions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5584  __pyx_r = NULL;
5585  __pyx_L0:;
5586  __Pyx_XGIVEREF(__pyx_r);
5587  __Pyx_TraceReturn(__pyx_r, 0);
5588  __Pyx_RefNannyFinishContext();
5589  return __pyx_r;
5590 }
5591 
5592 /* Python wrapper */
5593 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5594 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2 = {"lambda2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2, METH_VARARGS|METH_KEYWORDS, 0};
5595 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5596  CYTHON_UNUSED PyObject *__pyx_v_x = 0;
5597  PyObject *__pyx_v_t = 0;
5598  CYTHON_UNUSED PyObject *__pyx_v_n = 0;
5599  int __pyx_lineno = 0;
5600  const char *__pyx_filename = NULL;
5601  int __pyx_clineno = 0;
5602  PyObject *__pyx_r = 0;
5603  __Pyx_RefNannyDeclarations
5604  __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0);
5605  {
5606  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_n,0};
5607  PyObject* values[3] = {0,0,0};
5608  __pyx_defaults2 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self);
5609  values[2] = __pyx_dynamic_args->__pyx_arg_n;
5610  if (unlikely(__pyx_kwds)) {
5611  Py_ssize_t kw_args;
5612  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5613  switch (pos_args) {
5614  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5615  CYTHON_FALLTHROUGH;
5616  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5617  CYTHON_FALLTHROUGH;
5618  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5619  CYTHON_FALLTHROUGH;
5620  case 0: break;
5621  default: goto __pyx_L5_argtuple_error;
5622  }
5623  kw_args = PyDict_Size(__pyx_kwds);
5624  switch (pos_args) {
5625  case 0:
5626  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5627  else goto __pyx_L5_argtuple_error;
5628  CYTHON_FALLTHROUGH;
5629  case 1:
5630  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5631  else {
5632  __Pyx_RaiseArgtupleInvalid("lambda2", 0, 2, 3, 1); __PYX_ERR(0, 126, __pyx_L3_error)
5633  }
5634  CYTHON_FALLTHROUGH;
5635  case 2:
5636  if (kw_args > 0) {
5637  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
5638  if (value) { values[2] = value; kw_args--; }
5639  }
5640  }
5641  if (unlikely(kw_args > 0)) {
5642  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda2") < 0)) __PYX_ERR(0, 126, __pyx_L3_error)
5643  }
5644  } else {
5645  switch (PyTuple_GET_SIZE(__pyx_args)) {
5646  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5647  CYTHON_FALLTHROUGH;
5648  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5649  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5650  break;
5651  default: goto __pyx_L5_argtuple_error;
5652  }
5653  }
5654  __pyx_v_x = values[0];
5655  __pyx_v_t = values[1];
5656  __pyx_v_n = values[2];
5657  }
5658  goto __pyx_L4_argument_unpacking_done;
5659  __pyx_L5_argtuple_error:;
5660  __Pyx_RaiseArgtupleInvalid("lambda2", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 126, __pyx_L3_error)
5661  __pyx_L3_error:;
5662  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearRamp.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
5663  __Pyx_RefNannyFinishContext();
5664  return NULL;
5665  __pyx_L4_argument_unpacking_done:;
5666  __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_n);
5667 
5668  /* function exit code */
5669  __Pyx_RefNannyFinishContext();
5670  return __pyx_r;
5671 }
5672 
5673 static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n) {
5674  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_cur_scope;
5675  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_outer_scope;
5676  PyObject *__pyx_r = NULL;
5677  __Pyx_TraceDeclarations
5678  __Pyx_RefNannyDeclarations
5679  long __pyx_t_1;
5680  PyObject *__pyx_t_2 = NULL;
5681  PyObject *__pyx_t_3 = NULL;
5682  PyObject *__pyx_t_4 = NULL;
5683  PyObject *__pyx_t_5 = NULL;
5684  int __pyx_t_6;
5685  int __pyx_lineno = 0;
5686  const char *__pyx_filename = NULL;
5687  int __pyx_clineno = 0;
5688  __Pyx_RefNannySetupContext("lambda2", 0);
5689  __pyx_outer_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *) __Pyx_CyFunction_GetClosure(__pyx_self);
5690  __pyx_cur_scope = __pyx_outer_scope;
5691  __Pyx_TraceCall("lambda2", __pyx_f[0], 126, 0, __PYX_ERR(0, 126, __pyx_L1_error));
5692  __Pyx_XDECREF(__pyx_r);
5693  __pyx_t_1 = 1;
5694  if (unlikely(!__pyx_cur_scope->__pyx_v_t1)) { __Pyx_RaiseClosureNameError("t1"); __PYX_ERR(0, 126, __pyx_L1_error) }
5695  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_t, __pyx_cur_scope->__pyx_v_t1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5696  __Pyx_GOTREF(__pyx_t_2);
5697  __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
5698  __Pyx_GOTREF(__pyx_t_4);
5699  __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
5700  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5701  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 126, __pyx_L1_error)
5702  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5703  if (__pyx_t_6) {
5704  __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
5705  __Pyx_GOTREF(__pyx_t_5);
5706  __pyx_t_3 = __pyx_t_5;
5707  __pyx_t_5 = 0;
5708  } else {
5709  __Pyx_INCREF(__pyx_t_2);
5710  __pyx_t_3 = __pyx_t_2;
5711  }
5712  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5713  if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError("value"); __PYX_ERR(0, 126, __pyx_L1_error) }
5714  __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_cur_scope->__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5715  __Pyx_GOTREF(__pyx_t_2);
5716  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5717  __pyx_r = __pyx_t_2;
5718  __pyx_t_2 = 0;
5719  goto __pyx_L0;
5720 
5721  /* function exit code */
5722  __pyx_L1_error:;
5723  __Pyx_XDECREF(__pyx_t_2);
5724  __Pyx_XDECREF(__pyx_t_3);
5725  __Pyx_XDECREF(__pyx_t_4);
5726  __Pyx_XDECREF(__pyx_t_5);
5727  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearRamp.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
5728  __pyx_r = NULL;
5729  __pyx_L0:;
5730  __Pyx_XGIVEREF(__pyx_r);
5731  __Pyx_TraceReturn(__pyx_r, 0);
5732  __Pyx_RefNannyFinishContext();
5733  return __pyx_r;
5734 }
5735 
5736 /* "BoundaryConditions.py":115
5737  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:])
5738  *
5739  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
5740  * """
5741  * function setting a linear ramp from t=0 to t=t1
5742  */
5743 
5744 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_t1, PyObject *__pyx_v_value) {
5745  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_cur_scope;
5746  PyObject *__pyx_r = NULL;
5747  __Pyx_TraceDeclarations
5748  __Pyx_RefNannyDeclarations
5749  PyObject *__pyx_t_1 = NULL;
5750  PyObject *__pyx_t_2 = NULL;
5751  PyObject *__pyx_t_3 = NULL;
5752  PyObject *__pyx_t_4 = NULL;
5753  int __pyx_lineno = 0;
5754  const char *__pyx_filename = NULL;
5755  int __pyx_clineno = 0;
5756  __Pyx_TraceFrameInit(__pyx_codeobj__9)
5757  __Pyx_RefNannySetupContext("setLinearRamp", 0);
5758  __pyx_cur_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(__pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, __pyx_empty_tuple, NULL);
5759  if (unlikely(!__pyx_cur_scope)) {
5760  __pyx_cur_scope = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)Py_None);
5761  __Pyx_INCREF(Py_None);
5762  __PYX_ERR(0, 115, __pyx_L1_error)
5763  } else {
5764  __Pyx_GOTREF(__pyx_cur_scope);
5765  }
5766  __Pyx_TraceCall("setLinearRamp", __pyx_f[0], 115, 0, __PYX_ERR(0, 115, __pyx_L1_error));
5767  __pyx_cur_scope->__pyx_v_t1 = __pyx_v_t1;
5768  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_t1);
5769  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_t1);
5770  __pyx_cur_scope->__pyx_v_value = __pyx_v_value;
5771  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
5772  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
5773 
5774  /* "BoundaryConditions.py":126
5775  * Variable value
5776  * """
5777  * self.uOfXT = lambda x, t, n=np.zeros(3,): min( t/t1, 1)*value # <<<<<<<<<<<<<<
5778  */
5779  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2, 0, __pyx_n_s_setLinearRamp_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
5780  __Pyx_GOTREF(__pyx_t_1);
5781  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults2), 1)) __PYX_ERR(0, 126, __pyx_L1_error)
5782  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
5783  __Pyx_GOTREF(__pyx_t_3);
5784  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
5785  __Pyx_GOTREF(__pyx_t_4);
5786  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5787  __pyx_t_3 = NULL;
5788  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5789  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
5790  if (likely(__pyx_t_3)) {
5791  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5792  __Pyx_INCREF(__pyx_t_3);
5793  __Pyx_INCREF(function);
5794  __Pyx_DECREF_SET(__pyx_t_4, function);
5795  }
5796  }
5797  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
5798  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5799  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5800  __Pyx_GOTREF(__pyx_t_2);
5801  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5802  __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_1)->__pyx_arg_n = __pyx_t_2;
5803  __Pyx_GIVEREF(__pyx_t_2);
5804  __pyx_t_2 = 0;
5805  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_18BoundaryConditions_6__defaults__);
5806  __Pyx_GIVEREF(__pyx_t_1);
5807  __Pyx_GOTREF(__pyx_v_self->uOfXT);
5808  __Pyx_DECREF(__pyx_v_self->uOfXT);
5809  __pyx_v_self->uOfXT = __pyx_t_1;
5810  __pyx_t_1 = 0;
5811 
5812  /* "BoundaryConditions.py":115
5813  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:])
5814  *
5815  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
5816  * """
5817  * function setting a linear ramp from t=0 to t=t1
5818  */
5819 
5820  /* function exit code */
5821  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5822  goto __pyx_L0;
5823  __pyx_L1_error:;
5824  __Pyx_XDECREF(__pyx_t_1);
5825  __Pyx_XDECREF(__pyx_t_2);
5826  __Pyx_XDECREF(__pyx_t_3);
5827  __Pyx_XDECREF(__pyx_t_4);
5828  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearRamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
5829  __pyx_r = NULL;
5830  __pyx_L0:;
5831  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5832  __Pyx_XGIVEREF(__pyx_r);
5833  __Pyx_TraceReturn(__pyx_r, 0);
5834  __Pyx_RefNannyFinishContext();
5835  return __pyx_r;
5836 }
5837 
5838 /* "BoundaryConditions.pxd":20
5839  * cdef cpp_uOfXT uuOfXT
5840  * cdef public:
5841  * object uOfXT # <<<<<<<<<<<<<<
5842  * cpdef void resetBC(self)
5843  * # cpdef void setConstantBC(self, double value)
5844  */
5845 
5846 /* Python wrapper */
5847 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(PyObject *__pyx_v_self); /*proto*/
5848 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(PyObject *__pyx_v_self) {
5849  PyObject *__pyx_r = 0;
5850  __Pyx_RefNannyDeclarations
5851  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5852  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
5853 
5854  /* function exit code */
5855  __Pyx_RefNannyFinishContext();
5856  return __pyx_r;
5857 }
5858 
5859 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
5860  PyObject *__pyx_r = NULL;
5861  __Pyx_TraceDeclarations
5862  __Pyx_RefNannyDeclarations
5863  int __pyx_lineno = 0;
5864  const char *__pyx_filename = NULL;
5865  int __pyx_clineno = 0;
5866  __Pyx_RefNannySetupContext("__get__", 0);
5867  __Pyx_TraceCall("__get__", __pyx_f[2], 20, 0, __PYX_ERR(2, 20, __pyx_L1_error));
5868  __Pyx_XDECREF(__pyx_r);
5869  __Pyx_INCREF(__pyx_v_self->uOfXT);
5870  __pyx_r = __pyx_v_self->uOfXT;
5871  goto __pyx_L0;
5872 
5873  /* function exit code */
5874  __pyx_L1_error:;
5875  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.uOfXT.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5876  __pyx_r = NULL;
5877  __pyx_L0:;
5878  __Pyx_XGIVEREF(__pyx_r);
5879  __Pyx_TraceReturn(__pyx_r, 0);
5880  __Pyx_RefNannyFinishContext();
5881  return __pyx_r;
5882 }
5883 
5884 /* Python wrapper */
5885 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
5886 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
5887  int __pyx_r;
5888  __Pyx_RefNannyDeclarations
5889  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
5890  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v_value));
5891 
5892  /* function exit code */
5893  __Pyx_RefNannyFinishContext();
5894  return __pyx_r;
5895 }
5896 
5897 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value) {
5898  int __pyx_r;
5899  __Pyx_TraceDeclarations
5900  __Pyx_RefNannyDeclarations
5901  int __pyx_lineno = 0;
5902  const char *__pyx_filename = NULL;
5903  int __pyx_clineno = 0;
5904  __Pyx_RefNannySetupContext("__set__", 0);
5905  __Pyx_TraceCall("__set__", __pyx_f[2], 20, 0, __PYX_ERR(2, 20, __pyx_L1_error));
5906  __Pyx_INCREF(__pyx_v_value);
5907  __Pyx_GIVEREF(__pyx_v_value);
5908  __Pyx_GOTREF(__pyx_v_self->uOfXT);
5909  __Pyx_DECREF(__pyx_v_self->uOfXT);
5910  __pyx_v_self->uOfXT = __pyx_v_value;
5911 
5912  /* function exit code */
5913  __pyx_r = 0;
5914  goto __pyx_L0;
5915  __pyx_L1_error:;
5916  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.uOfXT.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5917  __pyx_r = -1;
5918  __pyx_L0:;
5919  __Pyx_TraceReturn(Py_None, 0);
5920  __Pyx_RefNannyFinishContext();
5921  return __pyx_r;
5922 }
5923 
5924 /* Python wrapper */
5925 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(PyObject *__pyx_v_self); /*proto*/
5926 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(PyObject *__pyx_v_self) {
5927  int __pyx_r;
5928  __Pyx_RefNannyDeclarations
5929  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
5930  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
5931 
5932  /* function exit code */
5933  __Pyx_RefNannyFinishContext();
5934  return __pyx_r;
5935 }
5936 
5937 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
5938  int __pyx_r;
5939  __Pyx_TraceDeclarations
5940  __Pyx_RefNannyDeclarations
5941  int __pyx_lineno = 0;
5942  const char *__pyx_filename = NULL;
5943  int __pyx_clineno = 0;
5944  __Pyx_RefNannySetupContext("__del__", 0);
5945  __Pyx_TraceCall("__del__", __pyx_f[2], 20, 0, __PYX_ERR(2, 20, __pyx_L1_error));
5946  __Pyx_INCREF(Py_None);
5947  __Pyx_GIVEREF(Py_None);
5948  __Pyx_GOTREF(__pyx_v_self->uOfXT);
5949  __Pyx_DECREF(__pyx_v_self->uOfXT);
5950  __pyx_v_self->uOfXT = Py_None;
5951 
5952  /* function exit code */
5953  __pyx_r = 0;
5954  goto __pyx_L0;
5955  __pyx_L1_error:;
5956  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.uOfXT.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5957  __pyx_r = -1;
5958  __pyx_L0:;
5959  __Pyx_TraceReturn(Py_None, 0);
5960  __Pyx_RefNannyFinishContext();
5961  return __pyx_r;
5962 }
5963 
5964 /* "(tree fragment)":1
5965  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5966  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
5967  * def __setstate_cython__(self, __pyx_state):
5968  */
5969 
5970 /* Python wrapper */
5971 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
5972 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__[] = "BoundaryCondition.__reduce_cython__(self)";
5973 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__};
5974 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5975  PyObject *__pyx_r = 0;
5976  __Pyx_RefNannyDeclarations
5977  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
5978  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
5979 
5980  /* function exit code */
5981  __Pyx_RefNannyFinishContext();
5982  return __pyx_r;
5983 }
5984 
5985 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
5986  PyObject *__pyx_r = NULL;
5987  __Pyx_TraceDeclarations
5988  __Pyx_RefNannyDeclarations
5989  PyObject *__pyx_t_1 = NULL;
5990  int __pyx_lineno = 0;
5991  const char *__pyx_filename = NULL;
5992  int __pyx_clineno = 0;
5993  __Pyx_TraceFrameInit(__pyx_codeobj__10)
5994  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
5995  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
5996 
5997  /* "(tree fragment)":2
5998  * def __reduce_cython__(self):
5999  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
6000  * def __setstate_cython__(self, __pyx_state):
6001  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
6002  */
6003  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
6004  __Pyx_GOTREF(__pyx_t_1);
6005  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6006  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6007  __PYX_ERR(1, 2, __pyx_L1_error)
6008 
6009  /* "(tree fragment)":1
6010  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6011  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
6012  * def __setstate_cython__(self, __pyx_state):
6013  */
6014 
6015  /* function exit code */
6016  __pyx_L1_error:;
6017  __Pyx_XDECREF(__pyx_t_1);
6018  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6019  __pyx_r = NULL;
6020  __Pyx_XGIVEREF(__pyx_r);
6021  __Pyx_TraceReturn(__pyx_r, 0);
6022  __Pyx_RefNannyFinishContext();
6023  return __pyx_r;
6024 }
6025 
6026 /* "(tree fragment)":3
6027  * def __reduce_cython__(self):
6028  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
6029  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6030  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
6031  */
6032 
6033 /* Python wrapper */
6034 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
6035 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__[] = "BoundaryCondition.__setstate_cython__(self, __pyx_state)";
6036 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__};
6037 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6038  PyObject *__pyx_r = 0;
6039  __Pyx_RefNannyDeclarations
6040  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6041  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
6042 
6043  /* function exit code */
6044  __Pyx_RefNannyFinishContext();
6045  return __pyx_r;
6046 }
6047 
6048 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6049  PyObject *__pyx_r = NULL;
6050  __Pyx_TraceDeclarations
6051  __Pyx_RefNannyDeclarations
6052  PyObject *__pyx_t_1 = NULL;
6053  int __pyx_lineno = 0;
6054  const char *__pyx_filename = NULL;
6055  int __pyx_clineno = 0;
6056  __Pyx_TraceFrameInit(__pyx_codeobj__12)
6057  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
6058  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
6059 
6060  /* "(tree fragment)":4
6061  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
6062  * def __setstate_cython__(self, __pyx_state):
6063  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
6064  */
6065  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
6066  __Pyx_GOTREF(__pyx_t_1);
6067  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6068  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6069  __PYX_ERR(1, 4, __pyx_L1_error)
6070 
6071  /* "(tree fragment)":3
6072  * def __reduce_cython__(self):
6073  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
6074  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6075  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
6076  */
6077 
6078  /* function exit code */
6079  __pyx_L1_error:;
6080  __Pyx_XDECREF(__pyx_t_1);
6081  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6082  __pyx_r = NULL;
6083  __Pyx_XGIVEREF(__pyx_r);
6084  __Pyx_TraceReturn(__pyx_r, 0);
6085  __Pyx_RefNannyFinishContext();
6086  return __pyx_r;
6087 }
6088 
6089 /* "(tree fragment)":1
6090  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
6091  * cdef object __pyx_PickleError
6092  * cdef object __pyx_result
6093  */
6094 
6095 /* Python wrapper */
6096 static PyObject *__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6097 static char __pyx_doc_18BoundaryConditions___pyx_unpickle_BC_Base[] = "__pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state)";
6098 static PyMethodDef __pyx_mdef_18BoundaryConditions_1__pyx_unpickle_BC_Base = {"__pyx_unpickle_BC_Base", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions___pyx_unpickle_BC_Base};
6099 static PyObject *__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6100  PyObject *__pyx_v___pyx_type = 0;
6101  long __pyx_v___pyx_checksum;
6102  PyObject *__pyx_v___pyx_state = 0;
6103  int __pyx_lineno = 0;
6104  const char *__pyx_filename = NULL;
6105  int __pyx_clineno = 0;
6106  PyObject *__pyx_r = 0;
6107  __Pyx_RefNannyDeclarations
6108  __Pyx_RefNannySetupContext("__pyx_unpickle_BC_Base (wrapper)", 0);
6109  {
6110  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
6111  PyObject* values[3] = {0,0,0};
6112  if (unlikely(__pyx_kwds)) {
6113  Py_ssize_t kw_args;
6114  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6115  switch (pos_args) {
6116  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6117  CYTHON_FALLTHROUGH;
6118  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6119  CYTHON_FALLTHROUGH;
6120  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6121  CYTHON_FALLTHROUGH;
6122  case 0: break;
6123  default: goto __pyx_L5_argtuple_error;
6124  }
6125  kw_args = PyDict_Size(__pyx_kwds);
6126  switch (pos_args) {
6127  case 0:
6128  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
6129  else goto __pyx_L5_argtuple_error;
6130  CYTHON_FALLTHROUGH;
6131  case 1:
6132  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
6133  else {
6134  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BC_Base", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
6135  }
6136  CYTHON_FALLTHROUGH;
6137  case 2:
6138  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
6139  else {
6140  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BC_Base", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
6141  }
6142  }
6143  if (unlikely(kw_args > 0)) {
6144  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_BC_Base") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
6145  }
6146  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6147  goto __pyx_L5_argtuple_error;
6148  } else {
6149  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6150  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6151  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6152  }
6153  __pyx_v___pyx_type = values[0];
6154  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
6155  __pyx_v___pyx_state = values[2];
6156  }
6157  goto __pyx_L4_argument_unpacking_done;
6158  __pyx_L5_argtuple_error:;
6159  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BC_Base", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
6160  __pyx_L3_error:;
6161  __Pyx_AddTraceback("BoundaryConditions.__pyx_unpickle_BC_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
6162  __Pyx_RefNannyFinishContext();
6163  return NULL;
6164  __pyx_L4_argument_unpacking_done:;
6165  __pyx_r = __pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
6166 
6167  /* function exit code */
6168  __Pyx_RefNannyFinishContext();
6169  return __pyx_r;
6170 }
6171 
6172 static PyObject *__pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
6173  PyObject *__pyx_v___pyx_PickleError = 0;
6174  PyObject *__pyx_v___pyx_result = 0;
6175  PyObject *__pyx_r = NULL;
6176  __Pyx_TraceDeclarations
6177  __Pyx_RefNannyDeclarations
6178  int __pyx_t_1;
6179  PyObject *__pyx_t_2 = NULL;
6180  PyObject *__pyx_t_3 = NULL;
6181  PyObject *__pyx_t_4 = NULL;
6182  PyObject *__pyx_t_5 = NULL;
6183  int __pyx_t_6;
6184  int __pyx_lineno = 0;
6185  const char *__pyx_filename = NULL;
6186  int __pyx_clineno = 0;
6187  __Pyx_TraceFrameInit(__pyx_codeobj__14)
6188  __Pyx_RefNannySetupContext("__pyx_unpickle_BC_Base", 0);
6189  __Pyx_TraceCall("__pyx_unpickle_BC_Base", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
6190 
6191  /* "(tree fragment)":4
6192  * cdef object __pyx_PickleError
6193  * cdef object __pyx_result
6194  * if __pyx_checksum != 0x96e6a1f: # <<<<<<<<<<<<<<
6195  * from pickle import PickleError as __pyx_PickleError
6196  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
6197  */
6198  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x96e6a1f) != 0);
6199  if (__pyx_t_1) {
6200 
6201  /* "(tree fragment)":5
6202  * cdef object __pyx_result
6203  * if __pyx_checksum != 0x96e6a1f:
6204  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
6205  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
6206  * __pyx_result = BC_Base.__new__(__pyx_type)
6207  */
6208  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
6209  __Pyx_GOTREF(__pyx_t_2);
6210  __Pyx_INCREF(__pyx_n_s_PickleError);
6211  __Pyx_GIVEREF(__pyx_n_s_PickleError);
6212  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
6213  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
6214  __Pyx_GOTREF(__pyx_t_3);
6215  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6216  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
6217  __Pyx_GOTREF(__pyx_t_2);
6218  __Pyx_INCREF(__pyx_t_2);
6219  __pyx_v___pyx_PickleError = __pyx_t_2;
6220  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6221  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6222 
6223  /* "(tree fragment)":6
6224  * if __pyx_checksum != 0x96e6a1f:
6225  * from pickle import PickleError as __pyx_PickleError
6226  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum) # <<<<<<<<<<<<<<
6227  * __pyx_result = BC_Base.__new__(__pyx_type)
6228  * if __pyx_state is not None:
6229  */
6230  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
6231  __Pyx_GOTREF(__pyx_t_2);
6232  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x96, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
6233  __Pyx_GOTREF(__pyx_t_4);
6234  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6235  __Pyx_INCREF(__pyx_v___pyx_PickleError);
6236  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
6237  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
6238  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
6239  if (likely(__pyx_t_5)) {
6240  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6241  __Pyx_INCREF(__pyx_t_5);
6242  __Pyx_INCREF(function);
6243  __Pyx_DECREF_SET(__pyx_t_2, function);
6244  }
6245  }
6246  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
6247  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6248  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6249  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
6250  __Pyx_GOTREF(__pyx_t_3);
6251  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6252  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6253  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6254  __PYX_ERR(1, 6, __pyx_L1_error)
6255 
6256  /* "(tree fragment)":4
6257  * cdef object __pyx_PickleError
6258  * cdef object __pyx_result
6259  * if __pyx_checksum != 0x96e6a1f: # <<<<<<<<<<<<<<
6260  * from pickle import PickleError as __pyx_PickleError
6261  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
6262  */
6263  }
6264 
6265  /* "(tree fragment)":7
6266  * from pickle import PickleError as __pyx_PickleError
6267  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
6268  * __pyx_result = BC_Base.__new__(__pyx_type) # <<<<<<<<<<<<<<
6269  * if __pyx_state is not None:
6270  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
6271  */
6272  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
6273  __Pyx_GOTREF(__pyx_t_2);
6274  __pyx_t_4 = NULL;
6275  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6276  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
6277  if (likely(__pyx_t_4)) {
6278  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6279  __Pyx_INCREF(__pyx_t_4);
6280  __Pyx_INCREF(function);
6281  __Pyx_DECREF_SET(__pyx_t_2, function);
6282  }
6283  }
6284  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
6285  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6286  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
6287  __Pyx_GOTREF(__pyx_t_3);
6288  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6289  __pyx_v___pyx_result = __pyx_t_3;
6290  __pyx_t_3 = 0;
6291 
6292  /* "(tree fragment)":8
6293  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
6294  * __pyx_result = BC_Base.__new__(__pyx_type)
6295  * if __pyx_state is not None: # <<<<<<<<<<<<<<
6296  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
6297  * return __pyx_result
6298  */
6299  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
6300  __pyx_t_6 = (__pyx_t_1 != 0);
6301  if (__pyx_t_6) {
6302 
6303  /* "(tree fragment)":9
6304  * __pyx_result = BC_Base.__new__(__pyx_type)
6305  * if __pyx_state is not None:
6306  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
6307  * return __pyx_result
6308  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
6309  */
6310  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
6311  __pyx_t_3 = __pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
6312  __Pyx_GOTREF(__pyx_t_3);
6313  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6314 
6315  /* "(tree fragment)":8
6316  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
6317  * __pyx_result = BC_Base.__new__(__pyx_type)
6318  * if __pyx_state is not None: # <<<<<<<<<<<<<<
6319  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
6320  * return __pyx_result
6321  */
6322  }
6323 
6324  /* "(tree fragment)":10
6325  * if __pyx_state is not None:
6326  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
6327  * return __pyx_result # <<<<<<<<<<<<<<
6328  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
6329  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
6330  */
6331  __Pyx_XDECREF(__pyx_r);
6332  __Pyx_INCREF(__pyx_v___pyx_result);
6333  __pyx_r = __pyx_v___pyx_result;
6334  goto __pyx_L0;
6335 
6336  /* "(tree fragment)":1
6337  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
6338  * cdef object __pyx_PickleError
6339  * cdef object __pyx_result
6340  */
6341 
6342  /* function exit code */
6343  __pyx_L1_error:;
6344  __Pyx_XDECREF(__pyx_t_2);
6345  __Pyx_XDECREF(__pyx_t_3);
6346  __Pyx_XDECREF(__pyx_t_4);
6347  __Pyx_XDECREF(__pyx_t_5);
6348  __Pyx_AddTraceback("BoundaryConditions.__pyx_unpickle_BC_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
6349  __pyx_r = NULL;
6350  __pyx_L0:;
6351  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
6352  __Pyx_XDECREF(__pyx_v___pyx_result);
6353  __Pyx_XGIVEREF(__pyx_r);
6354  __Pyx_TraceReturn(__pyx_r, 0);
6355  __Pyx_RefNannyFinishContext();
6356  return __pyx_r;
6357 }
6358 
6359 /* "(tree fragment)":11
6360  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
6361  * return __pyx_result
6362  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
6363  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
6364  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
6365  */
6366 
6367 static PyObject *__pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
6368  PyObject *__pyx_r = NULL;
6369  __Pyx_TraceDeclarations
6370  __Pyx_RefNannyDeclarations
6371  PyObject *__pyx_t_1 = NULL;
6372  __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
6373  int __pyx_t_3;
6374  int __pyx_t_4;
6375  Py_ssize_t __pyx_t_5;
6376  int __pyx_t_6;
6377  int __pyx_t_7;
6378  PyObject *__pyx_t_8 = NULL;
6379  PyObject *__pyx_t_9 = NULL;
6380  int __pyx_lineno = 0;
6381  const char *__pyx_filename = NULL;
6382  int __pyx_clineno = 0;
6383  __Pyx_RefNannySetupContext("__pyx_unpickle_BC_Base__set_state", 0);
6384  __Pyx_TraceCall("__pyx_unpickle_BC_Base__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
6385 
6386  /* "(tree fragment)":12
6387  * return __pyx_result
6388  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
6389  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5] # <<<<<<<<<<<<<<
6390  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
6391  * __pyx_result.__dict__.update(__pyx_state[6])
6392  */
6393  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6394  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6395  __PYX_ERR(1, 12, __pyx_L1_error)
6396  }
6397  if (!(likely(PyString_CheckExact(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0)))||((PyTuple_GET_ITEM(__pyx_v___pyx_state, 0)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0))->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
6398  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 0);
6399  __Pyx_INCREF(__pyx_t_1);
6400  __Pyx_GIVEREF(__pyx_t_1);
6401  __Pyx_GOTREF(__pyx_v___pyx_result->BC_type);
6402  __Pyx_DECREF(__pyx_v___pyx_result->BC_type);
6403  __pyx_v___pyx_result->BC_type = ((PyObject*)__pyx_t_1);
6404  __pyx_t_1 = 0;
6405  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6406  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6407  __PYX_ERR(1, 12, __pyx_L1_error)
6408  }
6409  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 1);
6410  __Pyx_INCREF(__pyx_t_1);
6411  __Pyx_GIVEREF(__pyx_t_1);
6412  __Pyx_GOTREF(__pyx_v___pyx_result->Shape);
6413  __Pyx_DECREF(__pyx_v___pyx_result->Shape);
6414  __pyx_v___pyx_result->Shape = __pyx_t_1;
6415  __pyx_t_1 = 0;
6416  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6417  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6418  __PYX_ERR(1, 12, __pyx_L1_error)
6419  }
6420  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyTuple_GET_ITEM(__pyx_v___pyx_state, 2), PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
6421  __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->_b_or, 0);
6422  __pyx_v___pyx_result->_b_or = __pyx_t_2;
6423  __pyx_t_2.memview = NULL;
6424  __pyx_t_2.data = NULL;
6425  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6426  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6427  __PYX_ERR(1, 12, __pyx_L1_error)
6428  }
6429  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 3);
6430  __Pyx_INCREF(__pyx_t_1);
6431  __Pyx_GIVEREF(__pyx_t_1);
6432  __Pyx_GOTREF(__pyx_v___pyx_result->ct);
6433  __Pyx_DECREF(__pyx_v___pyx_result->ct);
6434  __pyx_v___pyx_result->ct = __pyx_t_1;
6435  __pyx_t_1 = 0;
6436  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6437  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6438  __PYX_ERR(1, 12, __pyx_L1_error)
6439  }
6440  if (!(likely(PyString_CheckExact(PyTuple_GET_ITEM(__pyx_v___pyx_state, 4)))||((PyTuple_GET_ITEM(__pyx_v___pyx_state, 4)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(PyTuple_GET_ITEM(__pyx_v___pyx_state, 4))->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
6441  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 4);
6442  __Pyx_INCREF(__pyx_t_1);
6443  __Pyx_GIVEREF(__pyx_t_1);
6444  __Pyx_GOTREF(__pyx_v___pyx_result->name);
6445  __Pyx_DECREF(__pyx_v___pyx_result->name);
6446  __pyx_v___pyx_result->name = ((PyObject*)__pyx_t_1);
6447  __pyx_t_1 = 0;
6448  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6449  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6450  __PYX_ERR(1, 12, __pyx_L1_error)
6451  }
6452  __pyx_t_3 = __Pyx_PyInt_As_int(PyTuple_GET_ITEM(__pyx_v___pyx_state, 5)); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
6453  __pyx_v___pyx_result->nd = __pyx_t_3;
6454 
6455  /* "(tree fragment)":13
6456  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
6457  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
6458  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
6459  * __pyx_result.__dict__.update(__pyx_state[6])
6460  */
6461  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6462  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
6463  __PYX_ERR(1, 13, __pyx_L1_error)
6464  }
6465  __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
6466  __pyx_t_6 = ((__pyx_t_5 > 6) != 0);
6467  if (__pyx_t_6) {
6468  } else {
6469  __pyx_t_4 = __pyx_t_6;
6470  goto __pyx_L4_bool_binop_done;
6471  }
6472  __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
6473  __pyx_t_7 = (__pyx_t_6 != 0);
6474  __pyx_t_4 = __pyx_t_7;
6475  __pyx_L4_bool_binop_done:;
6476  if (__pyx_t_4) {
6477 
6478  /* "(tree fragment)":14
6479  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
6480  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
6481  * __pyx_result.__dict__.update(__pyx_state[6]) # <<<<<<<<<<<<<<
6482  */
6483  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
6484  __Pyx_GOTREF(__pyx_t_8);
6485  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
6486  __Pyx_GOTREF(__pyx_t_9);
6487  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6488  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6489  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6490  __PYX_ERR(1, 14, __pyx_L1_error)
6491  }
6492  __pyx_t_8 = NULL;
6493  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
6494  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
6495  if (likely(__pyx_t_8)) {
6496  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
6497  __Pyx_INCREF(__pyx_t_8);
6498  __Pyx_INCREF(function);
6499  __Pyx_DECREF_SET(__pyx_t_9, function);
6500  }
6501  }
6502  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_8, PyTuple_GET_ITEM(__pyx_v___pyx_state, 6)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, PyTuple_GET_ITEM(__pyx_v___pyx_state, 6));
6503  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6504  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
6505  __Pyx_GOTREF(__pyx_t_1);
6506  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6507  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6508 
6509  /* "(tree fragment)":13
6510  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
6511  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
6512  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
6513  * __pyx_result.__dict__.update(__pyx_state[6])
6514  */
6515  }
6516 
6517  /* "(tree fragment)":11
6518  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
6519  * return __pyx_result
6520  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
6521  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
6522  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
6523  */
6524 
6525  /* function exit code */
6526  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6527  goto __pyx_L0;
6528  __pyx_L1_error:;
6529  __Pyx_XDECREF(__pyx_t_1);
6530  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
6531  __Pyx_XDECREF(__pyx_t_8);
6532  __Pyx_XDECREF(__pyx_t_9);
6533  __Pyx_AddTraceback("BoundaryConditions.__pyx_unpickle_BC_Base__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
6534  __pyx_r = 0;
6535  __pyx_L0:;
6536  __Pyx_XGIVEREF(__pyx_r);
6537  __Pyx_TraceReturn(__pyx_r, 0);
6538  __Pyx_RefNannyFinishContext();
6539  return __pyx_r;
6540 }
6541 
6542 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":735
6543  * ctypedef npy_cdouble complex_t
6544  *
6545  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
6546  * return PyArray_MultiIterNew(1, <void*>a)
6547  *
6548  */
6549 
6550 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
6551  PyObject *__pyx_r = NULL;
6552  __Pyx_TraceDeclarations
6553  __Pyx_RefNannyDeclarations
6554  PyObject *__pyx_t_1 = NULL;
6555  int __pyx_lineno = 0;
6556  const char *__pyx_filename = NULL;
6557  int __pyx_clineno = 0;
6558  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
6559  __Pyx_TraceCall("PyArray_MultiIterNew1", __pyx_f[3], 735, 0, __PYX_ERR(3, 735, __pyx_L1_error));
6560 
6561  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":736
6562  *
6563  * cdef inline object PyArray_MultiIterNew1(a):
6564  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
6565  *
6566  * cdef inline object PyArray_MultiIterNew2(a, b):
6567  */
6568  __Pyx_XDECREF(__pyx_r);
6569  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 736, __pyx_L1_error)
6570  __Pyx_GOTREF(__pyx_t_1);
6571  __pyx_r = __pyx_t_1;
6572  __pyx_t_1 = 0;
6573  goto __pyx_L0;
6574 
6575  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":735
6576  * ctypedef npy_cdouble complex_t
6577  *
6578  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
6579  * return PyArray_MultiIterNew(1, <void*>a)
6580  *
6581  */
6582 
6583  /* function exit code */
6584  __pyx_L1_error:;
6585  __Pyx_XDECREF(__pyx_t_1);
6586  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
6587  __pyx_r = 0;
6588  __pyx_L0:;
6589  __Pyx_XGIVEREF(__pyx_r);
6590  __Pyx_TraceReturn(__pyx_r, 0);
6591  __Pyx_RefNannyFinishContext();
6592  return __pyx_r;
6593 }
6594 
6595 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":738
6596  * return PyArray_MultiIterNew(1, <void*>a)
6597  *
6598  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
6599  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6600  *
6601  */
6602 
6603 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
6604  PyObject *__pyx_r = NULL;
6605  __Pyx_TraceDeclarations
6606  __Pyx_RefNannyDeclarations
6607  PyObject *__pyx_t_1 = NULL;
6608  int __pyx_lineno = 0;
6609  const char *__pyx_filename = NULL;
6610  int __pyx_clineno = 0;
6611  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
6612  __Pyx_TraceCall("PyArray_MultiIterNew2", __pyx_f[3], 738, 0, __PYX_ERR(3, 738, __pyx_L1_error));
6613 
6614  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":739
6615  *
6616  * cdef inline object PyArray_MultiIterNew2(a, b):
6617  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
6618  *
6619  * cdef inline object PyArray_MultiIterNew3(a, b, c):
6620  */
6621  __Pyx_XDECREF(__pyx_r);
6622  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 739, __pyx_L1_error)
6623  __Pyx_GOTREF(__pyx_t_1);
6624  __pyx_r = __pyx_t_1;
6625  __pyx_t_1 = 0;
6626  goto __pyx_L0;
6627 
6628  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":738
6629  * return PyArray_MultiIterNew(1, <void*>a)
6630  *
6631  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
6632  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6633  *
6634  */
6635 
6636  /* function exit code */
6637  __pyx_L1_error:;
6638  __Pyx_XDECREF(__pyx_t_1);
6639  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
6640  __pyx_r = 0;
6641  __pyx_L0:;
6642  __Pyx_XGIVEREF(__pyx_r);
6643  __Pyx_TraceReturn(__pyx_r, 0);
6644  __Pyx_RefNannyFinishContext();
6645  return __pyx_r;
6646 }
6647 
6648 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":741
6649  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6650  *
6651  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
6652  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6653  *
6654  */
6655 
6656 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
6657  PyObject *__pyx_r = NULL;
6658  __Pyx_TraceDeclarations
6659  __Pyx_RefNannyDeclarations
6660  PyObject *__pyx_t_1 = NULL;
6661  int __pyx_lineno = 0;
6662  const char *__pyx_filename = NULL;
6663  int __pyx_clineno = 0;
6664  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
6665  __Pyx_TraceCall("PyArray_MultiIterNew3", __pyx_f[3], 741, 0, __PYX_ERR(3, 741, __pyx_L1_error));
6666 
6667  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":742
6668  *
6669  * cdef inline object PyArray_MultiIterNew3(a, b, c):
6670  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
6671  *
6672  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
6673  */
6674  __Pyx_XDECREF(__pyx_r);
6675  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 742, __pyx_L1_error)
6676  __Pyx_GOTREF(__pyx_t_1);
6677  __pyx_r = __pyx_t_1;
6678  __pyx_t_1 = 0;
6679  goto __pyx_L0;
6680 
6681  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":741
6682  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6683  *
6684  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
6685  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6686  *
6687  */
6688 
6689  /* function exit code */
6690  __pyx_L1_error:;
6691  __Pyx_XDECREF(__pyx_t_1);
6692  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
6693  __pyx_r = 0;
6694  __pyx_L0:;
6695  __Pyx_XGIVEREF(__pyx_r);
6696  __Pyx_TraceReturn(__pyx_r, 0);
6697  __Pyx_RefNannyFinishContext();
6698  return __pyx_r;
6699 }
6700 
6701 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":744
6702  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6703  *
6704  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
6705  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6706  *
6707  */
6708 
6709 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
6710  PyObject *__pyx_r = NULL;
6711  __Pyx_TraceDeclarations
6712  __Pyx_RefNannyDeclarations
6713  PyObject *__pyx_t_1 = NULL;
6714  int __pyx_lineno = 0;
6715  const char *__pyx_filename = NULL;
6716  int __pyx_clineno = 0;
6717  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
6718  __Pyx_TraceCall("PyArray_MultiIterNew4", __pyx_f[3], 744, 0, __PYX_ERR(3, 744, __pyx_L1_error));
6719 
6720  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":745
6721  *
6722  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
6723  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
6724  *
6725  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
6726  */
6727  __Pyx_XDECREF(__pyx_r);
6728  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 745, __pyx_L1_error)
6729  __Pyx_GOTREF(__pyx_t_1);
6730  __pyx_r = __pyx_t_1;
6731  __pyx_t_1 = 0;
6732  goto __pyx_L0;
6733 
6734  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":744
6735  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6736  *
6737  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
6738  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6739  *
6740  */
6741 
6742  /* function exit code */
6743  __pyx_L1_error:;
6744  __Pyx_XDECREF(__pyx_t_1);
6745  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
6746  __pyx_r = 0;
6747  __pyx_L0:;
6748  __Pyx_XGIVEREF(__pyx_r);
6749  __Pyx_TraceReturn(__pyx_r, 0);
6750  __Pyx_RefNannyFinishContext();
6751  return __pyx_r;
6752 }
6753 
6754 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":747
6755  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6756  *
6757  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
6758  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6759  *
6760  */
6761 
6762 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
6763  PyObject *__pyx_r = NULL;
6764  __Pyx_TraceDeclarations
6765  __Pyx_RefNannyDeclarations
6766  PyObject *__pyx_t_1 = NULL;
6767  int __pyx_lineno = 0;
6768  const char *__pyx_filename = NULL;
6769  int __pyx_clineno = 0;
6770  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
6771  __Pyx_TraceCall("PyArray_MultiIterNew5", __pyx_f[3], 747, 0, __PYX_ERR(3, 747, __pyx_L1_error));
6772 
6773  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":748
6774  *
6775  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
6776  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
6777  *
6778  * cdef inline tuple PyDataType_SHAPE(dtype d):
6779  */
6780  __Pyx_XDECREF(__pyx_r);
6781  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 748, __pyx_L1_error)
6782  __Pyx_GOTREF(__pyx_t_1);
6783  __pyx_r = __pyx_t_1;
6784  __pyx_t_1 = 0;
6785  goto __pyx_L0;
6786 
6787  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":747
6788  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6789  *
6790  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
6791  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6792  *
6793  */
6794 
6795  /* function exit code */
6796  __pyx_L1_error:;
6797  __Pyx_XDECREF(__pyx_t_1);
6798  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
6799  __pyx_r = 0;
6800  __pyx_L0:;
6801  __Pyx_XGIVEREF(__pyx_r);
6802  __Pyx_TraceReturn(__pyx_r, 0);
6803  __Pyx_RefNannyFinishContext();
6804  return __pyx_r;
6805 }
6806 
6807 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":750
6808  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6809  *
6810  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
6811  * if PyDataType_HASSUBARRAY(d):
6812  * return <tuple>d.subarray.shape
6813  */
6814 
6815 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
6816  PyObject *__pyx_r = NULL;
6817  __Pyx_TraceDeclarations
6818  __Pyx_RefNannyDeclarations
6819  int __pyx_t_1;
6820  int __pyx_lineno = 0;
6821  const char *__pyx_filename = NULL;
6822  int __pyx_clineno = 0;
6823  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
6824  __Pyx_TraceCall("PyDataType_SHAPE", __pyx_f[3], 750, 0, __PYX_ERR(3, 750, __pyx_L1_error));
6825 
6826  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":751
6827  *
6828  * cdef inline tuple PyDataType_SHAPE(dtype d):
6829  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
6830  * return <tuple>d.subarray.shape
6831  * else:
6832  */
6833  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
6834  if (__pyx_t_1) {
6835 
6836  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":752
6837  * cdef inline tuple PyDataType_SHAPE(dtype d):
6838  * if PyDataType_HASSUBARRAY(d):
6839  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
6840  * else:
6841  * return ()
6842  */
6843  __Pyx_XDECREF(__pyx_r);
6844  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
6845  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
6846  goto __pyx_L0;
6847 
6848  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":751
6849  *
6850  * cdef inline tuple PyDataType_SHAPE(dtype d):
6851  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
6852  * return <tuple>d.subarray.shape
6853  * else:
6854  */
6855  }
6856 
6857  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":754
6858  * return <tuple>d.subarray.shape
6859  * else:
6860  * return () # <<<<<<<<<<<<<<
6861  *
6862  *
6863  */
6864  /*else*/ {
6865  __Pyx_XDECREF(__pyx_r);
6866  __Pyx_INCREF(__pyx_empty_tuple);
6867  __pyx_r = __pyx_empty_tuple;
6868  goto __pyx_L0;
6869  }
6870 
6871  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":750
6872  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6873  *
6874  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
6875  * if PyDataType_HASSUBARRAY(d):
6876  * return <tuple>d.subarray.shape
6877  */
6878 
6879  /* function exit code */
6880  __pyx_L1_error:;
6881  __Pyx_AddTraceback("numpy.PyDataType_SHAPE", __pyx_clineno, __pyx_lineno, __pyx_filename);
6882  __pyx_r = 0;
6883  __pyx_L0:;
6884  __Pyx_XGIVEREF(__pyx_r);
6885  __Pyx_TraceReturn(__pyx_r, 0);
6886  __Pyx_RefNannyFinishContext();
6887  return __pyx_r;
6888 }
6889 
6890 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":929
6891  * int _import_umath() except -1
6892  *
6893  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
6894  * Py_INCREF(base) # important to do this before stealing the reference below!
6895  * PyArray_SetBaseObject(arr, base)
6896  */
6897 
6898 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
6899  __Pyx_TraceDeclarations
6900  __Pyx_RefNannyDeclarations
6901  int __pyx_lineno = 0;
6902  const char *__pyx_filename = NULL;
6903  int __pyx_clineno = 0;
6904  __Pyx_RefNannySetupContext("set_array_base", 0);
6905  __Pyx_TraceCall("set_array_base", __pyx_f[3], 929, 0, __PYX_ERR(3, 929, __pyx_L1_error));
6906 
6907  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":930
6908  *
6909  * cdef inline void set_array_base(ndarray arr, object base):
6910  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
6911  * PyArray_SetBaseObject(arr, base)
6912  *
6913  */
6914  Py_INCREF(__pyx_v_base);
6915 
6916  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":931
6917  * cdef inline void set_array_base(ndarray arr, object base):
6918  * Py_INCREF(base) # important to do this before stealing the reference below!
6919  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
6920  *
6921  * cdef inline object get_array_base(ndarray arr):
6922  */
6923  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
6924 
6925  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":929
6926  * int _import_umath() except -1
6927  *
6928  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
6929  * Py_INCREF(base) # important to do this before stealing the reference below!
6930  * PyArray_SetBaseObject(arr, base)
6931  */
6932 
6933  /* function exit code */
6934  goto __pyx_L0;
6935  __pyx_L1_error:;
6936  __Pyx_WriteUnraisable("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6937  __pyx_L0:;
6938  __Pyx_TraceReturn(Py_None, 0);
6939  __Pyx_RefNannyFinishContext();
6940 }
6941 
6942 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":933
6943  * PyArray_SetBaseObject(arr, base)
6944  *
6945  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
6946  * base = PyArray_BASE(arr)
6947  * if base is NULL:
6948  */
6949 
6950 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
6951  PyObject *__pyx_v_base;
6952  PyObject *__pyx_r = NULL;
6953  __Pyx_TraceDeclarations
6954  __Pyx_RefNannyDeclarations
6955  int __pyx_t_1;
6956  int __pyx_lineno = 0;
6957  const char *__pyx_filename = NULL;
6958  int __pyx_clineno = 0;
6959  __Pyx_RefNannySetupContext("get_array_base", 0);
6960  __Pyx_TraceCall("get_array_base", __pyx_f[3], 933, 0, __PYX_ERR(3, 933, __pyx_L1_error));
6961 
6962  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":934
6963  *
6964  * cdef inline object get_array_base(ndarray arr):
6965  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
6966  * if base is NULL:
6967  * return None
6968  */
6969  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
6970 
6971  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":935
6972  * cdef inline object get_array_base(ndarray arr):
6973  * base = PyArray_BASE(arr)
6974  * if base is NULL: # <<<<<<<<<<<<<<
6975  * return None
6976  * return <object>base
6977  */
6978  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
6979  if (__pyx_t_1) {
6980 
6981  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":936
6982  * base = PyArray_BASE(arr)
6983  * if base is NULL:
6984  * return None # <<<<<<<<<<<<<<
6985  * return <object>base
6986  *
6987  */
6988  __Pyx_XDECREF(__pyx_r);
6989  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6990  goto __pyx_L0;
6991 
6992  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":935
6993  * cdef inline object get_array_base(ndarray arr):
6994  * base = PyArray_BASE(arr)
6995  * if base is NULL: # <<<<<<<<<<<<<<
6996  * return None
6997  * return <object>base
6998  */
6999  }
7000 
7001  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":937
7002  * if base is NULL:
7003  * return None
7004  * return <object>base # <<<<<<<<<<<<<<
7005  *
7006  * # Versions of the import_* functions which are more suitable for
7007  */
7008  __Pyx_XDECREF(__pyx_r);
7009  __Pyx_INCREF(((PyObject *)__pyx_v_base));
7010  __pyx_r = ((PyObject *)__pyx_v_base);
7011  goto __pyx_L0;
7012 
7013  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":933
7014  * PyArray_SetBaseObject(arr, base)
7015  *
7016  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7017  * base = PyArray_BASE(arr)
7018  * if base is NULL:
7019  */
7020 
7021  /* function exit code */
7022  __pyx_L1_error:;
7023  __Pyx_AddTraceback("numpy.get_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
7024  __pyx_r = 0;
7025  __pyx_L0:;
7026  __Pyx_XGIVEREF(__pyx_r);
7027  __Pyx_TraceReturn(__pyx_r, 0);
7028  __Pyx_RefNannyFinishContext();
7029  return __pyx_r;
7030 }
7031 
7032 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":941
7033  * # Versions of the import_* functions which are more suitable for
7034  * # Cython code.
7035  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7036  * try:
7037  * __pyx_import_array()
7038  */
7039 
7040 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
7041  int __pyx_r;
7042  __Pyx_TraceDeclarations
7043  __Pyx_RefNannyDeclarations
7044  PyObject *__pyx_t_1 = NULL;
7045  PyObject *__pyx_t_2 = NULL;
7046  PyObject *__pyx_t_3 = NULL;
7047  int __pyx_t_4;
7048  PyObject *__pyx_t_5 = NULL;
7049  PyObject *__pyx_t_6 = NULL;
7050  PyObject *__pyx_t_7 = NULL;
7051  PyObject *__pyx_t_8 = NULL;
7052  int __pyx_lineno = 0;
7053  const char *__pyx_filename = NULL;
7054  int __pyx_clineno = 0;
7055  __Pyx_RefNannySetupContext("import_array", 0);
7056  __Pyx_TraceCall("import_array", __pyx_f[3], 941, 0, __PYX_ERR(3, 941, __pyx_L1_error));
7057 
7058  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":942
7059  * # Cython code.
7060  * cdef inline int import_array() except -1:
7061  * try: # <<<<<<<<<<<<<<
7062  * __pyx_import_array()
7063  * except Exception:
7064  */
7065  {
7066  __Pyx_PyThreadState_declare
7067  __Pyx_PyThreadState_assign
7068  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7069  __Pyx_XGOTREF(__pyx_t_1);
7070  __Pyx_XGOTREF(__pyx_t_2);
7071  __Pyx_XGOTREF(__pyx_t_3);
7072  /*try:*/ {
7073 
7074  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":943
7075  * cdef inline int import_array() except -1:
7076  * try:
7077  * __pyx_import_array() # <<<<<<<<<<<<<<
7078  * except Exception:
7079  * raise ImportError("numpy.core.multiarray failed to import")
7080  */
7081  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 943, __pyx_L3_error)
7082 
7083  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":942
7084  * # Cython code.
7085  * cdef inline int import_array() except -1:
7086  * try: # <<<<<<<<<<<<<<
7087  * __pyx_import_array()
7088  * except Exception:
7089  */
7090  }
7091  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7092  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7093  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7094  goto __pyx_L8_try_end;
7095  __pyx_L3_error:;
7096 
7097  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":944
7098  * try:
7099  * __pyx_import_array()
7100  * except Exception: # <<<<<<<<<<<<<<
7101  * raise ImportError("numpy.core.multiarray failed to import")
7102  *
7103  */
7104  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7105  if (__pyx_t_4) {
7106  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7107  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 944, __pyx_L5_except_error)
7108  __Pyx_GOTREF(__pyx_t_5);
7109  __Pyx_GOTREF(__pyx_t_6);
7110  __Pyx_GOTREF(__pyx_t_7);
7111 
7112  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":945
7113  * __pyx_import_array()
7114  * except Exception:
7115  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
7116  *
7117  * cdef inline int import_umath() except -1:
7118  */
7119  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 945, __pyx_L5_except_error)
7120  __Pyx_GOTREF(__pyx_t_8);
7121  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7122  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7123  __PYX_ERR(3, 945, __pyx_L5_except_error)
7124  }
7125  goto __pyx_L5_except_error;
7126  __pyx_L5_except_error:;
7127 
7128  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":942
7129  * # Cython code.
7130  * cdef inline int import_array() except -1:
7131  * try: # <<<<<<<<<<<<<<
7132  * __pyx_import_array()
7133  * except Exception:
7134  */
7135  __Pyx_XGIVEREF(__pyx_t_1);
7136  __Pyx_XGIVEREF(__pyx_t_2);
7137  __Pyx_XGIVEREF(__pyx_t_3);
7138  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7139  goto __pyx_L1_error;
7140  __pyx_L8_try_end:;
7141  }
7142 
7143  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":941
7144  * # Versions of the import_* functions which are more suitable for
7145  * # Cython code.
7146  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7147  * try:
7148  * __pyx_import_array()
7149  */
7150 
7151  /* function exit code */
7152  __pyx_r = 0;
7153  goto __pyx_L0;
7154  __pyx_L1_error:;
7155  __Pyx_XDECREF(__pyx_t_5);
7156  __Pyx_XDECREF(__pyx_t_6);
7157  __Pyx_XDECREF(__pyx_t_7);
7158  __Pyx_XDECREF(__pyx_t_8);
7159  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7160  __pyx_r = -1;
7161  __pyx_L0:;
7162  __Pyx_TraceReturn(Py_None, 0);
7163  __Pyx_RefNannyFinishContext();
7164  return __pyx_r;
7165 }
7166 
7167 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":947
7168  * raise ImportError("numpy.core.multiarray failed to import")
7169  *
7170  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
7171  * try:
7172  * _import_umath()
7173  */
7174 
7175 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
7176  int __pyx_r;
7177  __Pyx_TraceDeclarations
7178  __Pyx_RefNannyDeclarations
7179  PyObject *__pyx_t_1 = NULL;
7180  PyObject *__pyx_t_2 = NULL;
7181  PyObject *__pyx_t_3 = NULL;
7182  int __pyx_t_4;
7183  PyObject *__pyx_t_5 = NULL;
7184  PyObject *__pyx_t_6 = NULL;
7185  PyObject *__pyx_t_7 = NULL;
7186  PyObject *__pyx_t_8 = NULL;
7187  int __pyx_lineno = 0;
7188  const char *__pyx_filename = NULL;
7189  int __pyx_clineno = 0;
7190  __Pyx_RefNannySetupContext("import_umath", 0);
7191  __Pyx_TraceCall("import_umath", __pyx_f[3], 947, 0, __PYX_ERR(3, 947, __pyx_L1_error));
7192 
7193  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":948
7194  *
7195  * cdef inline int import_umath() except -1:
7196  * try: # <<<<<<<<<<<<<<
7197  * _import_umath()
7198  * except Exception:
7199  */
7200  {
7201  __Pyx_PyThreadState_declare
7202  __Pyx_PyThreadState_assign
7203  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7204  __Pyx_XGOTREF(__pyx_t_1);
7205  __Pyx_XGOTREF(__pyx_t_2);
7206  __Pyx_XGOTREF(__pyx_t_3);
7207  /*try:*/ {
7208 
7209  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":949
7210  * cdef inline int import_umath() except -1:
7211  * try:
7212  * _import_umath() # <<<<<<<<<<<<<<
7213  * except Exception:
7214  * raise ImportError("numpy.core.umath failed to import")
7215  */
7216  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 949, __pyx_L3_error)
7217 
7218  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":948
7219  *
7220  * cdef inline int import_umath() except -1:
7221  * try: # <<<<<<<<<<<<<<
7222  * _import_umath()
7223  * except Exception:
7224  */
7225  }
7226  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7227  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7228  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7229  goto __pyx_L8_try_end;
7230  __pyx_L3_error:;
7231 
7232  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":950
7233  * try:
7234  * _import_umath()
7235  * except Exception: # <<<<<<<<<<<<<<
7236  * raise ImportError("numpy.core.umath failed to import")
7237  *
7238  */
7239  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7240  if (__pyx_t_4) {
7241  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7242  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 950, __pyx_L5_except_error)
7243  __Pyx_GOTREF(__pyx_t_5);
7244  __Pyx_GOTREF(__pyx_t_6);
7245  __Pyx_GOTREF(__pyx_t_7);
7246 
7247  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":951
7248  * _import_umath()
7249  * except Exception:
7250  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
7251  *
7252  * cdef inline int import_ufunc() except -1:
7253  */
7254  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 951, __pyx_L5_except_error)
7255  __Pyx_GOTREF(__pyx_t_8);
7256  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7257  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7258  __PYX_ERR(3, 951, __pyx_L5_except_error)
7259  }
7260  goto __pyx_L5_except_error;
7261  __pyx_L5_except_error:;
7262 
7263  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":948
7264  *
7265  * cdef inline int import_umath() except -1:
7266  * try: # <<<<<<<<<<<<<<
7267  * _import_umath()
7268  * except Exception:
7269  */
7270  __Pyx_XGIVEREF(__pyx_t_1);
7271  __Pyx_XGIVEREF(__pyx_t_2);
7272  __Pyx_XGIVEREF(__pyx_t_3);
7273  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7274  goto __pyx_L1_error;
7275  __pyx_L8_try_end:;
7276  }
7277 
7278  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":947
7279  * raise ImportError("numpy.core.multiarray failed to import")
7280  *
7281  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
7282  * try:
7283  * _import_umath()
7284  */
7285 
7286  /* function exit code */
7287  __pyx_r = 0;
7288  goto __pyx_L0;
7289  __pyx_L1_error:;
7290  __Pyx_XDECREF(__pyx_t_5);
7291  __Pyx_XDECREF(__pyx_t_6);
7292  __Pyx_XDECREF(__pyx_t_7);
7293  __Pyx_XDECREF(__pyx_t_8);
7294  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7295  __pyx_r = -1;
7296  __pyx_L0:;
7297  __Pyx_TraceReturn(Py_None, 0);
7298  __Pyx_RefNannyFinishContext();
7299  return __pyx_r;
7300 }
7301 
7302 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":953
7303  * raise ImportError("numpy.core.umath failed to import")
7304  *
7305  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
7306  * try:
7307  * _import_umath()
7308  */
7309 
7310 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
7311  int __pyx_r;
7312  __Pyx_TraceDeclarations
7313  __Pyx_RefNannyDeclarations
7314  PyObject *__pyx_t_1 = NULL;
7315  PyObject *__pyx_t_2 = NULL;
7316  PyObject *__pyx_t_3 = NULL;
7317  int __pyx_t_4;
7318  PyObject *__pyx_t_5 = NULL;
7319  PyObject *__pyx_t_6 = NULL;
7320  PyObject *__pyx_t_7 = NULL;
7321  PyObject *__pyx_t_8 = NULL;
7322  int __pyx_lineno = 0;
7323  const char *__pyx_filename = NULL;
7324  int __pyx_clineno = 0;
7325  __Pyx_RefNannySetupContext("import_ufunc", 0);
7326  __Pyx_TraceCall("import_ufunc", __pyx_f[3], 953, 0, __PYX_ERR(3, 953, __pyx_L1_error));
7327 
7328  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":954
7329  *
7330  * cdef inline int import_ufunc() except -1:
7331  * try: # <<<<<<<<<<<<<<
7332  * _import_umath()
7333  * except Exception:
7334  */
7335  {
7336  __Pyx_PyThreadState_declare
7337  __Pyx_PyThreadState_assign
7338  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7339  __Pyx_XGOTREF(__pyx_t_1);
7340  __Pyx_XGOTREF(__pyx_t_2);
7341  __Pyx_XGOTREF(__pyx_t_3);
7342  /*try:*/ {
7343 
7344  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":955
7345  * cdef inline int import_ufunc() except -1:
7346  * try:
7347  * _import_umath() # <<<<<<<<<<<<<<
7348  * except Exception:
7349  * raise ImportError("numpy.core.umath failed to import")
7350  */
7351  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 955, __pyx_L3_error)
7352 
7353  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":954
7354  *
7355  * cdef inline int import_ufunc() except -1:
7356  * try: # <<<<<<<<<<<<<<
7357  * _import_umath()
7358  * except Exception:
7359  */
7360  }
7361  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7362  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7363  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7364  goto __pyx_L8_try_end;
7365  __pyx_L3_error:;
7366 
7367  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":956
7368  * try:
7369  * _import_umath()
7370  * except Exception: # <<<<<<<<<<<<<<
7371  * raise ImportError("numpy.core.umath failed to import")
7372  *
7373  */
7374  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7375  if (__pyx_t_4) {
7376  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
7377  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 956, __pyx_L5_except_error)
7378  __Pyx_GOTREF(__pyx_t_5);
7379  __Pyx_GOTREF(__pyx_t_6);
7380  __Pyx_GOTREF(__pyx_t_7);
7381 
7382  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":957
7383  * _import_umath()
7384  * except Exception:
7385  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
7386  *
7387  * cdef extern from *:
7388  */
7389  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 957, __pyx_L5_except_error)
7390  __Pyx_GOTREF(__pyx_t_8);
7391  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7392  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7393  __PYX_ERR(3, 957, __pyx_L5_except_error)
7394  }
7395  goto __pyx_L5_except_error;
7396  __pyx_L5_except_error:;
7397 
7398  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":954
7399  *
7400  * cdef inline int import_ufunc() except -1:
7401  * try: # <<<<<<<<<<<<<<
7402  * _import_umath()
7403  * except Exception:
7404  */
7405  __Pyx_XGIVEREF(__pyx_t_1);
7406  __Pyx_XGIVEREF(__pyx_t_2);
7407  __Pyx_XGIVEREF(__pyx_t_3);
7408  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7409  goto __pyx_L1_error;
7410  __pyx_L8_try_end:;
7411  }
7412 
7413  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":953
7414  * raise ImportError("numpy.core.umath failed to import")
7415  *
7416  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
7417  * try:
7418  * _import_umath()
7419  */
7420 
7421  /* function exit code */
7422  __pyx_r = 0;
7423  goto __pyx_L0;
7424  __pyx_L1_error:;
7425  __Pyx_XDECREF(__pyx_t_5);
7426  __Pyx_XDECREF(__pyx_t_6);
7427  __Pyx_XDECREF(__pyx_t_7);
7428  __Pyx_XDECREF(__pyx_t_8);
7429  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
7430  __pyx_r = -1;
7431  __pyx_L0:;
7432  __Pyx_TraceReturn(Py_None, 0);
7433  __Pyx_RefNannyFinishContext();
7434  return __pyx_r;
7435 }
7436 
7437 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":967
7438  *
7439  *
7440  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
7441  * """
7442  * Cython equivalent of `isinstance(obj, np.timedelta64)`
7443  */
7444 
7445 static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
7446  int __pyx_r;
7447  __Pyx_TraceDeclarations
7448  __Pyx_RefNannyDeclarations
7449  int __pyx_lineno = 0;
7450  const char *__pyx_filename = NULL;
7451  int __pyx_clineno = 0;
7452  __Pyx_RefNannySetupContext("is_timedelta64_object", 0);
7453  __Pyx_TraceCall("is_timedelta64_object", __pyx_f[3], 967, 0, __PYX_ERR(3, 967, __pyx_L1_error));
7454 
7455  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":979
7456  * bool
7457  * """
7458  * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
7459  *
7460  *
7461  */
7462  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
7463  goto __pyx_L0;
7464 
7465  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":967
7466  *
7467  *
7468  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
7469  * """
7470  * Cython equivalent of `isinstance(obj, np.timedelta64)`
7471  */
7472 
7473  /* function exit code */
7474  __pyx_L1_error:;
7475  __Pyx_WriteUnraisable("numpy.is_timedelta64_object", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
7476  __pyx_r = 0;
7477  __pyx_L0:;
7478  __Pyx_TraceReturn(Py_None, 0);
7479  __Pyx_RefNannyFinishContext();
7480  return __pyx_r;
7481 }
7482 
7483 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":982
7484  *
7485  *
7486  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
7487  * """
7488  * Cython equivalent of `isinstance(obj, np.datetime64)`
7489  */
7490 
7491 static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
7492  int __pyx_r;
7493  __Pyx_TraceDeclarations
7494  __Pyx_RefNannyDeclarations
7495  int __pyx_lineno = 0;
7496  const char *__pyx_filename = NULL;
7497  int __pyx_clineno = 0;
7498  __Pyx_RefNannySetupContext("is_datetime64_object", 0);
7499  __Pyx_TraceCall("is_datetime64_object", __pyx_f[3], 982, 0, __PYX_ERR(3, 982, __pyx_L1_error));
7500 
7501  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":994
7502  * bool
7503  * """
7504  * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
7505  *
7506  *
7507  */
7508  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
7509  goto __pyx_L0;
7510 
7511  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":982
7512  *
7513  *
7514  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
7515  * """
7516  * Cython equivalent of `isinstance(obj, np.datetime64)`
7517  */
7518 
7519  /* function exit code */
7520  __pyx_L1_error:;
7521  __Pyx_WriteUnraisable("numpy.is_datetime64_object", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
7522  __pyx_r = 0;
7523  __pyx_L0:;
7524  __Pyx_TraceReturn(Py_None, 0);
7525  __Pyx_RefNannyFinishContext();
7526  return __pyx_r;
7527 }
7528 
7529 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":997
7530  *
7531  *
7532  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
7533  * """
7534  * returns the int64 value underlying scalar numpy datetime64 object
7535  */
7536 
7537 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
7538  npy_datetime __pyx_r;
7539  __Pyx_TraceDeclarations
7540  int __pyx_lineno = 0;
7541  const char *__pyx_filename = NULL;
7542  int __pyx_clineno = 0;
7543  __Pyx_TraceCall("get_datetime64_value", __pyx_f[3], 997, 1, __PYX_ERR(3, 997, __pyx_L1_error));
7544 
7545  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1004
7546  * also needed. That can be found using `get_datetime64_unit`.
7547  * """
7548  * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
7549  *
7550  *
7551  */
7552  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
7553  goto __pyx_L0;
7554 
7555  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":997
7556  *
7557  *
7558  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
7559  * """
7560  * returns the int64 value underlying scalar numpy datetime64 object
7561  */
7562 
7563  /* function exit code */
7564  __pyx_L1_error:;
7565  __Pyx_WriteUnraisable("numpy.get_datetime64_value", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
7566  __pyx_r = 0;
7567  __pyx_L0:;
7568  __Pyx_TraceReturn(Py_None, 1);
7569  return __pyx_r;
7570 }
7571 
7572 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1007
7573  *
7574  *
7575  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
7576  * """
7577  * returns the int64 value underlying scalar numpy timedelta64 object
7578  */
7579 
7580 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
7581  npy_timedelta __pyx_r;
7582  __Pyx_TraceDeclarations
7583  int __pyx_lineno = 0;
7584  const char *__pyx_filename = NULL;
7585  int __pyx_clineno = 0;
7586  __Pyx_TraceCall("get_timedelta64_value", __pyx_f[3], 1007, 1, __PYX_ERR(3, 1007, __pyx_L1_error));
7587 
7588  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1011
7589  * returns the int64 value underlying scalar numpy timedelta64 object
7590  * """
7591  * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
7592  *
7593  *
7594  */
7595  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
7596  goto __pyx_L0;
7597 
7598  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1007
7599  *
7600  *
7601  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
7602  * """
7603  * returns the int64 value underlying scalar numpy timedelta64 object
7604  */
7605 
7606  /* function exit code */
7607  __pyx_L1_error:;
7608  __Pyx_WriteUnraisable("numpy.get_timedelta64_value", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
7609  __pyx_r = 0;
7610  __pyx_L0:;
7611  __Pyx_TraceReturn(Py_None, 1);
7612  return __pyx_r;
7613 }
7614 
7615 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1014
7616  *
7617  *
7618  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
7619  * """
7620  * returns the unit part of the dtype for a numpy datetime64 object.
7621  */
7622 
7623 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
7624  NPY_DATETIMEUNIT __pyx_r;
7625  __Pyx_TraceDeclarations
7626  int __pyx_lineno = 0;
7627  const char *__pyx_filename = NULL;
7628  int __pyx_clineno = 0;
7629  __Pyx_TraceCall("get_datetime64_unit", __pyx_f[3], 1014, 1, __PYX_ERR(3, 1014, __pyx_L1_error));
7630 
7631  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1018
7632  * returns the unit part of the dtype for a numpy datetime64 object.
7633  * """
7634  * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
7635  */
7636  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
7637  goto __pyx_L0;
7638 
7639  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1014
7640  *
7641  *
7642  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
7643  * """
7644  * returns the unit part of the dtype for a numpy datetime64 object.
7645  */
7646 
7647  /* function exit code */
7648  __pyx_L1_error:;
7649  __Pyx_WriteUnraisable("numpy.get_datetime64_unit", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
7650  __pyx_r = (NPY_DATETIMEUNIT) 0;
7651  __pyx_L0:;
7652  __Pyx_TraceReturn(Py_None, 1);
7653  return __pyx_r;
7654 }
7655 
7656 /* "View.MemoryView":122
7657  * cdef bint dtype_is_object
7658  *
7659  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
7660  * mode="c", bint allocate_buffer=True):
7661  *
7662  */
7663 
7664 /* Python wrapper */
7665 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7666 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7667  PyObject *__pyx_v_shape = 0;
7668  Py_ssize_t __pyx_v_itemsize;
7669  PyObject *__pyx_v_format = 0;
7670  PyObject *__pyx_v_mode = 0;
7671  int __pyx_v_allocate_buffer;
7672  int __pyx_lineno = 0;
7673  const char *__pyx_filename = NULL;
7674  int __pyx_clineno = 0;
7675  int __pyx_r;
7676  __Pyx_RefNannyDeclarations
7677  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
7678  {
7679  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
7680  PyObject* values[5] = {0,0,0,0,0};
7681  values[3] = ((PyObject *)__pyx_n_s_c);
7682  if (unlikely(__pyx_kwds)) {
7683  Py_ssize_t kw_args;
7684  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7685  switch (pos_args) {
7686  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7687  CYTHON_FALLTHROUGH;
7688  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7689  CYTHON_FALLTHROUGH;
7690  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7691  CYTHON_FALLTHROUGH;
7692  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7693  CYTHON_FALLTHROUGH;
7694  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7695  CYTHON_FALLTHROUGH;
7696  case 0: break;
7697  default: goto __pyx_L5_argtuple_error;
7698  }
7699  kw_args = PyDict_Size(__pyx_kwds);
7700  switch (pos_args) {
7701  case 0:
7702  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
7703  else goto __pyx_L5_argtuple_error;
7704  CYTHON_FALLTHROUGH;
7705  case 1:
7706  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
7707  else {
7708  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
7709  }
7710  CYTHON_FALLTHROUGH;
7711  case 2:
7712  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
7713  else {
7714  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
7715  }
7716  CYTHON_FALLTHROUGH;
7717  case 3:
7718  if (kw_args > 0) {
7719  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
7720  if (value) { values[3] = value; kw_args--; }
7721  }
7722  CYTHON_FALLTHROUGH;
7723  case 4:
7724  if (kw_args > 0) {
7725  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
7726  if (value) { values[4] = value; kw_args--; }
7727  }
7728  }
7729  if (unlikely(kw_args > 0)) {
7730  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
7731  }
7732  } else {
7733  switch (PyTuple_GET_SIZE(__pyx_args)) {
7734  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7735  CYTHON_FALLTHROUGH;
7736  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7737  CYTHON_FALLTHROUGH;
7738  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7739  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7740  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7741  break;
7742  default: goto __pyx_L5_argtuple_error;
7743  }
7744  }
7745  __pyx_v_shape = ((PyObject*)values[0]);
7746  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
7747  __pyx_v_format = values[2];
7748  __pyx_v_mode = values[3];
7749  if (values[4]) {
7750  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
7751  } else {
7752 
7753  /* "View.MemoryView":123
7754  *
7755  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
7756  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
7757  *
7758  * cdef int idx
7759  */
7760  __pyx_v_allocate_buffer = ((int)1);
7761  }
7762  }
7763  goto __pyx_L4_argument_unpacking_done;
7764  __pyx_L5_argtuple_error:;
7765  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
7766  __pyx_L3_error:;
7767  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7768  __Pyx_RefNannyFinishContext();
7769  return -1;
7770  __pyx_L4_argument_unpacking_done:;
7771  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
7772  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
7773  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 122, __pyx_L1_error)
7774  }
7775  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
7776 
7777  /* "View.MemoryView":122
7778  * cdef bint dtype_is_object
7779  *
7780  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
7781  * mode="c", bint allocate_buffer=True):
7782  *
7783  */
7784 
7785  /* function exit code */
7786  goto __pyx_L0;
7787  __pyx_L1_error:;
7788  __pyx_r = -1;
7789  __pyx_L0:;
7790  __Pyx_RefNannyFinishContext();
7791  return __pyx_r;
7792 }
7793 
7794 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
7795  int __pyx_v_idx;
7796  Py_ssize_t __pyx_v_i;
7797  Py_ssize_t __pyx_v_dim;
7798  PyObject **__pyx_v_p;
7799  char __pyx_v_order;
7800  int __pyx_r;
7801  __Pyx_TraceDeclarations
7802  __Pyx_RefNannyDeclarations
7803  Py_ssize_t __pyx_t_1;
7804  int __pyx_t_2;
7805  PyObject *__pyx_t_3 = NULL;
7806  int __pyx_t_4;
7807  PyObject *__pyx_t_5 = NULL;
7808  PyObject *__pyx_t_6 = NULL;
7809  char *__pyx_t_7;
7810  int __pyx_t_8;
7811  Py_ssize_t __pyx_t_9;
7812  PyObject *__pyx_t_10 = NULL;
7813  Py_ssize_t __pyx_t_11;
7814  int __pyx_lineno = 0;
7815  const char *__pyx_filename = NULL;
7816  int __pyx_clineno = 0;
7817  __Pyx_RefNannySetupContext("__cinit__", 0);
7818  __Pyx_TraceCall("__cinit__", __pyx_f[1], 122, 0, __PYX_ERR(1, 122, __pyx_L1_error));
7819  __Pyx_INCREF(__pyx_v_format);
7820 
7821  /* "View.MemoryView":129
7822  * cdef PyObject **p
7823  *
7824  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
7825  * self.itemsize = itemsize
7826  *
7827  */
7828  if (unlikely(__pyx_v_shape == Py_None)) {
7829  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
7830  __PYX_ERR(1, 129, __pyx_L1_error)
7831  }
7832  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
7833  __pyx_v_self->ndim = ((int)__pyx_t_1);
7834 
7835  /* "View.MemoryView":130
7836  *
7837  * self.ndim = <int> len(shape)
7838  * self.itemsize = itemsize # <<<<<<<<<<<<<<
7839  *
7840  * if not self.ndim:
7841  */
7842  __pyx_v_self->itemsize = __pyx_v_itemsize;
7843 
7844  /* "View.MemoryView":132
7845  * self.itemsize = itemsize
7846  *
7847  * if not self.ndim: # <<<<<<<<<<<<<<
7848  * raise ValueError("Empty shape tuple for cython.array")
7849  *
7850  */
7851  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
7852  if (unlikely(__pyx_t_2)) {
7853 
7854  /* "View.MemoryView":133
7855  *
7856  * if not self.ndim:
7857  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
7858  *
7859  * if itemsize <= 0:
7860  */
7861  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
7862  __Pyx_GOTREF(__pyx_t_3);
7863  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7864  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7865  __PYX_ERR(1, 133, __pyx_L1_error)
7866 
7867  /* "View.MemoryView":132
7868  * self.itemsize = itemsize
7869  *
7870  * if not self.ndim: # <<<<<<<<<<<<<<
7871  * raise ValueError("Empty shape tuple for cython.array")
7872  *
7873  */
7874  }
7875 
7876  /* "View.MemoryView":135
7877  * raise ValueError("Empty shape tuple for cython.array")
7878  *
7879  * if itemsize <= 0: # <<<<<<<<<<<<<<
7880  * raise ValueError("itemsize <= 0 for cython.array")
7881  *
7882  */
7883  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
7884  if (unlikely(__pyx_t_2)) {
7885 
7886  /* "View.MemoryView":136
7887  *
7888  * if itemsize <= 0:
7889  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
7890  *
7891  * if not isinstance(format, bytes):
7892  */
7893  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
7894  __Pyx_GOTREF(__pyx_t_3);
7895  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7896  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7897  __PYX_ERR(1, 136, __pyx_L1_error)
7898 
7899  /* "View.MemoryView":135
7900  * raise ValueError("Empty shape tuple for cython.array")
7901  *
7902  * if itemsize <= 0: # <<<<<<<<<<<<<<
7903  * raise ValueError("itemsize <= 0 for cython.array")
7904  *
7905  */
7906  }
7907 
7908  /* "View.MemoryView":138
7909  * raise ValueError("itemsize <= 0 for cython.array")
7910  *
7911  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
7912  * format = format.encode('ASCII')
7913  * self._format = format # keep a reference to the byte string
7914  */
7915  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
7916  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
7917  if (__pyx_t_4) {
7918 
7919  /* "View.MemoryView":139
7920  *
7921  * if not isinstance(format, bytes):
7922  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
7923  * self._format = format # keep a reference to the byte string
7924  * self.format = self._format
7925  */
7926  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
7927  __Pyx_GOTREF(__pyx_t_5);
7928  __pyx_t_6 = NULL;
7929  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
7930  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
7931  if (likely(__pyx_t_6)) {
7932  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
7933  __Pyx_INCREF(__pyx_t_6);
7934  __Pyx_INCREF(function);
7935  __Pyx_DECREF_SET(__pyx_t_5, function);
7936  }
7937  }
7938  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
7939  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7940  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
7941  __Pyx_GOTREF(__pyx_t_3);
7942  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7943  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
7944  __pyx_t_3 = 0;
7945 
7946  /* "View.MemoryView":138
7947  * raise ValueError("itemsize <= 0 for cython.array")
7948  *
7949  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
7950  * format = format.encode('ASCII')
7951  * self._format = format # keep a reference to the byte string
7952  */
7953  }
7954 
7955  /* "View.MemoryView":140
7956  * if not isinstance(format, bytes):
7957  * format = format.encode('ASCII')
7958  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
7959  * self.format = self._format
7960  *
7961  */
7962  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
7963  __pyx_t_3 = __pyx_v_format;
7964  __Pyx_INCREF(__pyx_t_3);
7965  __Pyx_GIVEREF(__pyx_t_3);
7966  __Pyx_GOTREF(__pyx_v_self->_format);
7967  __Pyx_DECREF(__pyx_v_self->_format);
7968  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
7969  __pyx_t_3 = 0;
7970 
7971  /* "View.MemoryView":141
7972  * format = format.encode('ASCII')
7973  * self._format = format # keep a reference to the byte string
7974  * self.format = self._format # <<<<<<<<<<<<<<
7975  *
7976  *
7977  */
7978  if (unlikely(__pyx_v_self->_format == Py_None)) {
7979  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
7980  __PYX_ERR(1, 141, __pyx_L1_error)
7981  }
7982  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
7983  __pyx_v_self->format = __pyx_t_7;
7984 
7985  /* "View.MemoryView":144
7986  *
7987  *
7988  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
7989  * self._strides = self._shape + self.ndim
7990  *
7991  */
7992  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
7993 
7994  /* "View.MemoryView":145
7995  *
7996  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
7997  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
7998  *
7999  * if not self._shape:
8000  */
8001  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
8002 
8003  /* "View.MemoryView":147
8004  * self._strides = self._shape + self.ndim
8005  *
8006  * if not self._shape: # <<<<<<<<<<<<<<
8007  * raise MemoryError("unable to allocate shape and strides.")
8008  *
8009  */
8010  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
8011  if (unlikely(__pyx_t_4)) {
8012 
8013  /* "View.MemoryView":148
8014  *
8015  * if not self._shape:
8016  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
8017  *
8018  *
8019  */
8020  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
8021  __Pyx_GOTREF(__pyx_t_3);
8022  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8023  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8024  __PYX_ERR(1, 148, __pyx_L1_error)
8025 
8026  /* "View.MemoryView":147
8027  * self._strides = self._shape + self.ndim
8028  *
8029  * if not self._shape: # <<<<<<<<<<<<<<
8030  * raise MemoryError("unable to allocate shape and strides.")
8031  *
8032  */
8033  }
8034 
8035  /* "View.MemoryView":151
8036  *
8037  *
8038  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8039  * if dim <= 0:
8040  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8041  */
8042  __pyx_t_8 = 0;
8043  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
8044  for (;;) {
8045  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
8046  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8047  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
8048  #else
8049  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
8050  __Pyx_GOTREF(__pyx_t_5);
8051  #endif
8052  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
8053  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8054  __pyx_v_dim = __pyx_t_9;
8055  __pyx_v_idx = __pyx_t_8;
8056  __pyx_t_8 = (__pyx_t_8 + 1);
8057 
8058  /* "View.MemoryView":152
8059  *
8060  * for idx, dim in enumerate(shape):
8061  * if dim <= 0: # <<<<<<<<<<<<<<
8062  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8063  * self._shape[idx] = dim
8064  */
8065  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
8066  if (unlikely(__pyx_t_4)) {
8067 
8068  /* "View.MemoryView":153
8069  * for idx, dim in enumerate(shape):
8070  * if dim <= 0:
8071  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
8072  * self._shape[idx] = dim
8073  *
8074  */
8075  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
8076  __Pyx_GOTREF(__pyx_t_5);
8077  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
8078  __Pyx_GOTREF(__pyx_t_6);
8079  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
8080  __Pyx_GOTREF(__pyx_t_10);
8081  __Pyx_GIVEREF(__pyx_t_5);
8082  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
8083  __Pyx_GIVEREF(__pyx_t_6);
8084  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
8085  __pyx_t_5 = 0;
8086  __pyx_t_6 = 0;
8087  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
8088  __Pyx_GOTREF(__pyx_t_6);
8089  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8090  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
8091  __Pyx_GOTREF(__pyx_t_10);
8092  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8093  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8094  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8095  __PYX_ERR(1, 153, __pyx_L1_error)
8096 
8097  /* "View.MemoryView":152
8098  *
8099  * for idx, dim in enumerate(shape):
8100  * if dim <= 0: # <<<<<<<<<<<<<<
8101  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8102  * self._shape[idx] = dim
8103  */
8104  }
8105 
8106  /* "View.MemoryView":154
8107  * if dim <= 0:
8108  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8109  * self._shape[idx] = dim # <<<<<<<<<<<<<<
8110  *
8111  * cdef char order
8112  */
8113  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
8114 
8115  /* "View.MemoryView":151
8116  *
8117  *
8118  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8119  * if dim <= 0:
8120  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8121  */
8122  }
8123  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8124 
8125  /* "View.MemoryView":157
8126  *
8127  * cdef char order
8128  * if mode == 'fortran': # <<<<<<<<<<<<<<
8129  * order = b'F'
8130  * self.mode = u'fortran'
8131  */
8132  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
8133  if (__pyx_t_4) {
8134 
8135  /* "View.MemoryView":158
8136  * cdef char order
8137  * if mode == 'fortran':
8138  * order = b'F' # <<<<<<<<<<<<<<
8139  * self.mode = u'fortran'
8140  * elif mode == 'c':
8141  */
8142  __pyx_v_order = 'F';
8143 
8144  /* "View.MemoryView":159
8145  * if mode == 'fortran':
8146  * order = b'F'
8147  * self.mode = u'fortran' # <<<<<<<<<<<<<<
8148  * elif mode == 'c':
8149  * order = b'C'
8150  */
8151  __Pyx_INCREF(__pyx_n_u_fortran);
8152  __Pyx_GIVEREF(__pyx_n_u_fortran);
8153  __Pyx_GOTREF(__pyx_v_self->mode);
8154  __Pyx_DECREF(__pyx_v_self->mode);
8155  __pyx_v_self->mode = __pyx_n_u_fortran;
8156 
8157  /* "View.MemoryView":157
8158  *
8159  * cdef char order
8160  * if mode == 'fortran': # <<<<<<<<<<<<<<
8161  * order = b'F'
8162  * self.mode = u'fortran'
8163  */
8164  goto __pyx_L10;
8165  }
8166 
8167  /* "View.MemoryView":160
8168  * order = b'F'
8169  * self.mode = u'fortran'
8170  * elif mode == 'c': # <<<<<<<<<<<<<<
8171  * order = b'C'
8172  * self.mode = u'c'
8173  */
8174  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
8175  if (likely(__pyx_t_4)) {
8176 
8177  /* "View.MemoryView":161
8178  * self.mode = u'fortran'
8179  * elif mode == 'c':
8180  * order = b'C' # <<<<<<<<<<<<<<
8181  * self.mode = u'c'
8182  * else:
8183  */
8184  __pyx_v_order = 'C';
8185 
8186  /* "View.MemoryView":162
8187  * elif mode == 'c':
8188  * order = b'C'
8189  * self.mode = u'c' # <<<<<<<<<<<<<<
8190  * else:
8191  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8192  */
8193  __Pyx_INCREF(__pyx_n_u_c);
8194  __Pyx_GIVEREF(__pyx_n_u_c);
8195  __Pyx_GOTREF(__pyx_v_self->mode);
8196  __Pyx_DECREF(__pyx_v_self->mode);
8197  __pyx_v_self->mode = __pyx_n_u_c;
8198 
8199  /* "View.MemoryView":160
8200  * order = b'F'
8201  * self.mode = u'fortran'
8202  * elif mode == 'c': # <<<<<<<<<<<<<<
8203  * order = b'C'
8204  * self.mode = u'c'
8205  */
8206  goto __pyx_L10;
8207  }
8208 
8209  /* "View.MemoryView":164
8210  * self.mode = u'c'
8211  * else:
8212  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
8213  *
8214  * self.len = fill_contig_strides_array(self._shape, self._strides,
8215  */
8216  /*else*/ {
8217  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
8218  __Pyx_GOTREF(__pyx_t_3);
8219  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
8220  __Pyx_GOTREF(__pyx_t_10);
8221  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8222  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8223  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8224  __PYX_ERR(1, 164, __pyx_L1_error)
8225  }
8226  __pyx_L10:;
8227 
8228  /* "View.MemoryView":166
8229  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8230  *
8231  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
8232  * itemsize, self.ndim, order)
8233  *
8234  */
8235  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
8236 
8237  /* "View.MemoryView":169
8238  * itemsize, self.ndim, order)
8239  *
8240  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
8241  * self.dtype_is_object = format == b'O'
8242  * if allocate_buffer:
8243  */
8244  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
8245 
8246  /* "View.MemoryView":170
8247  *
8248  * self.free_data = allocate_buffer
8249  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
8250  * if allocate_buffer:
8251  *
8252  */
8253  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
8254  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
8255  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8256  __pyx_v_self->dtype_is_object = __pyx_t_4;
8257 
8258  /* "View.MemoryView":171
8259  * self.free_data = allocate_buffer
8260  * self.dtype_is_object = format == b'O'
8261  * if allocate_buffer: # <<<<<<<<<<<<<<
8262  *
8263  *
8264  */
8265  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
8266  if (__pyx_t_4) {
8267 
8268  /* "View.MemoryView":174
8269  *
8270  *
8271  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
8272  * if not self.data:
8273  * raise MemoryError("unable to allocate array data.")
8274  */
8275  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
8276 
8277  /* "View.MemoryView":175
8278  *
8279  * self.data = <char *>malloc(self.len)
8280  * if not self.data: # <<<<<<<<<<<<<<
8281  * raise MemoryError("unable to allocate array data.")
8282  *
8283  */
8284  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
8285  if (unlikely(__pyx_t_4)) {
8286 
8287  /* "View.MemoryView":176
8288  * self.data = <char *>malloc(self.len)
8289  * if not self.data:
8290  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
8291  *
8292  * if self.dtype_is_object:
8293  */
8294  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
8295  __Pyx_GOTREF(__pyx_t_10);
8296  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8297  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8298  __PYX_ERR(1, 176, __pyx_L1_error)
8299 
8300  /* "View.MemoryView":175
8301  *
8302  * self.data = <char *>malloc(self.len)
8303  * if not self.data: # <<<<<<<<<<<<<<
8304  * raise MemoryError("unable to allocate array data.")
8305  *
8306  */
8307  }
8308 
8309  /* "View.MemoryView":178
8310  * raise MemoryError("unable to allocate array data.")
8311  *
8312  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8313  * p = <PyObject **> self.data
8314  * for i in range(self.len / itemsize):
8315  */
8316  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
8317  if (__pyx_t_4) {
8318 
8319  /* "View.MemoryView":179
8320  *
8321  * if self.dtype_is_object:
8322  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
8323  * for i in range(self.len / itemsize):
8324  * p[i] = Py_None
8325  */
8326  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
8327 
8328  /* "View.MemoryView":180
8329  * if self.dtype_is_object:
8330  * p = <PyObject **> self.data
8331  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
8332  * p[i] = Py_None
8333  * Py_INCREF(Py_None)
8334  */
8335  if (unlikely(__pyx_v_itemsize == 0)) {
8336  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
8337  __PYX_ERR(1, 180, __pyx_L1_error)
8338  }
8339  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
8340  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
8341  __PYX_ERR(1, 180, __pyx_L1_error)
8342  }
8343  __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
8344  __pyx_t_9 = __pyx_t_1;
8345  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
8346  __pyx_v_i = __pyx_t_11;
8347 
8348  /* "View.MemoryView":181
8349  * p = <PyObject **> self.data
8350  * for i in range(self.len / itemsize):
8351  * p[i] = Py_None # <<<<<<<<<<<<<<
8352  * Py_INCREF(Py_None)
8353  *
8354  */
8355  (__pyx_v_p[__pyx_v_i]) = Py_None;
8356 
8357  /* "View.MemoryView":182
8358  * for i in range(self.len / itemsize):
8359  * p[i] = Py_None
8360  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
8361  *
8362  * @cname('getbuffer')
8363  */
8364  Py_INCREF(Py_None);
8365  }
8366 
8367  /* "View.MemoryView":178
8368  * raise MemoryError("unable to allocate array data.")
8369  *
8370  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8371  * p = <PyObject **> self.data
8372  * for i in range(self.len / itemsize):
8373  */
8374  }
8375 
8376  /* "View.MemoryView":171
8377  * self.free_data = allocate_buffer
8378  * self.dtype_is_object = format == b'O'
8379  * if allocate_buffer: # <<<<<<<<<<<<<<
8380  *
8381  *
8382  */
8383  }
8384 
8385  /* "View.MemoryView":122
8386  * cdef bint dtype_is_object
8387  *
8388  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8389  * mode="c", bint allocate_buffer=True):
8390  *
8391  */
8392 
8393  /* function exit code */
8394  __pyx_r = 0;
8395  goto __pyx_L0;
8396  __pyx_L1_error:;
8397  __Pyx_XDECREF(__pyx_t_3);
8398  __Pyx_XDECREF(__pyx_t_5);
8399  __Pyx_XDECREF(__pyx_t_6);
8400  __Pyx_XDECREF(__pyx_t_10);
8401  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8402  __pyx_r = -1;
8403  __pyx_L0:;
8404  __Pyx_XDECREF(__pyx_v_format);
8405  __Pyx_TraceReturn(Py_None, 0);
8406  __Pyx_RefNannyFinishContext();
8407  return __pyx_r;
8408 }
8409 
8410 /* "View.MemoryView":185
8411  *
8412  * @cname('getbuffer')
8413  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
8414  * cdef int bufmode = -1
8415  * if self.mode == u"c":
8416  */
8417 
8418 /* Python wrapper */
8419 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
8420 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
8421  int __pyx_r;
8422  __Pyx_RefNannyDeclarations
8423  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
8424  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
8425 
8426  /* function exit code */
8427  __Pyx_RefNannyFinishContext();
8428  return __pyx_r;
8429 }
8430 
8431 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
8432  int __pyx_v_bufmode;
8433  int __pyx_r;
8434  __Pyx_TraceDeclarations
8435  __Pyx_RefNannyDeclarations
8436  int __pyx_t_1;
8437  int __pyx_t_2;
8438  PyObject *__pyx_t_3 = NULL;
8439  char *__pyx_t_4;
8440  Py_ssize_t __pyx_t_5;
8441  int __pyx_t_6;
8442  Py_ssize_t *__pyx_t_7;
8443  int __pyx_lineno = 0;
8444  const char *__pyx_filename = NULL;
8445  int __pyx_clineno = 0;
8446  if (__pyx_v_info == NULL) {
8447  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
8448  return -1;
8449  }
8450  __Pyx_RefNannySetupContext("__getbuffer__", 0);
8451  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
8452  __Pyx_GIVEREF(__pyx_v_info->obj);
8453  __Pyx_TraceCall("__getbuffer__", __pyx_f[1], 185, 0, __PYX_ERR(1, 185, __pyx_L1_error));
8454 
8455  /* "View.MemoryView":186
8456  * @cname('getbuffer')
8457  * def __getbuffer__(self, Py_buffer *info, int flags):
8458  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
8459  * if self.mode == u"c":
8460  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8461  */
8462  __pyx_v_bufmode = -1;
8463 
8464  /* "View.MemoryView":187
8465  * def __getbuffer__(self, Py_buffer *info, int flags):
8466  * cdef int bufmode = -1
8467  * if self.mode == u"c": # <<<<<<<<<<<<<<
8468  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8469  * elif self.mode == u"fortran":
8470  */
8471  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
8472  __pyx_t_2 = (__pyx_t_1 != 0);
8473  if (__pyx_t_2) {
8474 
8475  /* "View.MemoryView":188
8476  * cdef int bufmode = -1
8477  * if self.mode == u"c":
8478  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
8479  * elif self.mode == u"fortran":
8480  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8481  */
8482  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8483 
8484  /* "View.MemoryView":187
8485  * def __getbuffer__(self, Py_buffer *info, int flags):
8486  * cdef int bufmode = -1
8487  * if self.mode == u"c": # <<<<<<<<<<<<<<
8488  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8489  * elif self.mode == u"fortran":
8490  */
8491  goto __pyx_L3;
8492  }
8493 
8494  /* "View.MemoryView":189
8495  * if self.mode == u"c":
8496  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8497  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
8498  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8499  * if not (flags & bufmode):
8500  */
8501  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
8502  __pyx_t_1 = (__pyx_t_2 != 0);
8503  if (__pyx_t_1) {
8504 
8505  /* "View.MemoryView":190
8506  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8507  * elif self.mode == u"fortran":
8508  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
8509  * if not (flags & bufmode):
8510  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8511  */
8512  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8513 
8514  /* "View.MemoryView":189
8515  * if self.mode == u"c":
8516  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8517  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
8518  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8519  * if not (flags & bufmode):
8520  */
8521  }
8522  __pyx_L3:;
8523 
8524  /* "View.MemoryView":191
8525  * elif self.mode == u"fortran":
8526  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8527  * if not (flags & bufmode): # <<<<<<<<<<<<<<
8528  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8529  * info.buf = self.data
8530  */
8531  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
8532  if (unlikely(__pyx_t_1)) {
8533 
8534  /* "View.MemoryView":192
8535  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8536  * if not (flags & bufmode):
8537  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
8538  * info.buf = self.data
8539  * info.len = self.len
8540  */
8541  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
8542  __Pyx_GOTREF(__pyx_t_3);
8543  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8544  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8545  __PYX_ERR(1, 192, __pyx_L1_error)
8546 
8547  /* "View.MemoryView":191
8548  * elif self.mode == u"fortran":
8549  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8550  * if not (flags & bufmode): # <<<<<<<<<<<<<<
8551  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8552  * info.buf = self.data
8553  */
8554  }
8555 
8556  /* "View.MemoryView":193
8557  * if not (flags & bufmode):
8558  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8559  * info.buf = self.data # <<<<<<<<<<<<<<
8560  * info.len = self.len
8561  * info.ndim = self.ndim
8562  */
8563  __pyx_t_4 = __pyx_v_self->data;
8564  __pyx_v_info->buf = __pyx_t_4;
8565 
8566  /* "View.MemoryView":194
8567  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8568  * info.buf = self.data
8569  * info.len = self.len # <<<<<<<<<<<<<<
8570  * info.ndim = self.ndim
8571  * info.shape = self._shape
8572  */
8573  __pyx_t_5 = __pyx_v_self->len;
8574  __pyx_v_info->len = __pyx_t_5;
8575 
8576  /* "View.MemoryView":195
8577  * info.buf = self.data
8578  * info.len = self.len
8579  * info.ndim = self.ndim # <<<<<<<<<<<<<<
8580  * info.shape = self._shape
8581  * info.strides = self._strides
8582  */
8583  __pyx_t_6 = __pyx_v_self->ndim;
8584  __pyx_v_info->ndim = __pyx_t_6;
8585 
8586  /* "View.MemoryView":196
8587  * info.len = self.len
8588  * info.ndim = self.ndim
8589  * info.shape = self._shape # <<<<<<<<<<<<<<
8590  * info.strides = self._strides
8591  * info.suboffsets = NULL
8592  */
8593  __pyx_t_7 = __pyx_v_self->_shape;
8594  __pyx_v_info->shape = __pyx_t_7;
8595 
8596  /* "View.MemoryView":197
8597  * info.ndim = self.ndim
8598  * info.shape = self._shape
8599  * info.strides = self._strides # <<<<<<<<<<<<<<
8600  * info.suboffsets = NULL
8601  * info.itemsize = self.itemsize
8602  */
8603  __pyx_t_7 = __pyx_v_self->_strides;
8604  __pyx_v_info->strides = __pyx_t_7;
8605 
8606  /* "View.MemoryView":198
8607  * info.shape = self._shape
8608  * info.strides = self._strides
8609  * info.suboffsets = NULL # <<<<<<<<<<<<<<
8610  * info.itemsize = self.itemsize
8611  * info.readonly = 0
8612  */
8613  __pyx_v_info->suboffsets = NULL;
8614 
8615  /* "View.MemoryView":199
8616  * info.strides = self._strides
8617  * info.suboffsets = NULL
8618  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
8619  * info.readonly = 0
8620  *
8621  */
8622  __pyx_t_5 = __pyx_v_self->itemsize;
8623  __pyx_v_info->itemsize = __pyx_t_5;
8624 
8625  /* "View.MemoryView":200
8626  * info.suboffsets = NULL
8627  * info.itemsize = self.itemsize
8628  * info.readonly = 0 # <<<<<<<<<<<<<<
8629  *
8630  * if flags & PyBUF_FORMAT:
8631  */
8632  __pyx_v_info->readonly = 0;
8633 
8634  /* "View.MemoryView":202
8635  * info.readonly = 0
8636  *
8637  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8638  * info.format = self.format
8639  * else:
8640  */
8641  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8642  if (__pyx_t_1) {
8643 
8644  /* "View.MemoryView":203
8645  *
8646  * if flags & PyBUF_FORMAT:
8647  * info.format = self.format # <<<<<<<<<<<<<<
8648  * else:
8649  * info.format = NULL
8650  */
8651  __pyx_t_4 = __pyx_v_self->format;
8652  __pyx_v_info->format = __pyx_t_4;
8653 
8654  /* "View.MemoryView":202
8655  * info.readonly = 0
8656  *
8657  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8658  * info.format = self.format
8659  * else:
8660  */
8661  goto __pyx_L5;
8662  }
8663 
8664  /* "View.MemoryView":205
8665  * info.format = self.format
8666  * else:
8667  * info.format = NULL # <<<<<<<<<<<<<<
8668  *
8669  * info.obj = self
8670  */
8671  /*else*/ {
8672  __pyx_v_info->format = NULL;
8673  }
8674  __pyx_L5:;
8675 
8676  /* "View.MemoryView":207
8677  * info.format = NULL
8678  *
8679  * info.obj = self # <<<<<<<<<<<<<<
8680  *
8681  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8682  */
8683  __Pyx_INCREF(((PyObject *)__pyx_v_self));
8684  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8685  __Pyx_GOTREF(__pyx_v_info->obj);
8686  __Pyx_DECREF(__pyx_v_info->obj);
8687  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
8688 
8689  /* "View.MemoryView":185
8690  *
8691  * @cname('getbuffer')
8692  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
8693  * cdef int bufmode = -1
8694  * if self.mode == u"c":
8695  */
8696 
8697  /* function exit code */
8698  __pyx_r = 0;
8699  goto __pyx_L0;
8700  __pyx_L1_error:;
8701  __Pyx_XDECREF(__pyx_t_3);
8702  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8703  __pyx_r = -1;
8704  if (__pyx_v_info->obj != NULL) {
8705  __Pyx_GOTREF(__pyx_v_info->obj);
8706  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8707  }
8708  goto __pyx_L2;
8709  __pyx_L0:;
8710  if (__pyx_v_info->obj == Py_None) {
8711  __Pyx_GOTREF(__pyx_v_info->obj);
8712  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8713  }
8714  __pyx_L2:;
8715  __Pyx_TraceReturn(Py_None, 0);
8716  __Pyx_RefNannyFinishContext();
8717  return __pyx_r;
8718 }
8719 
8720 /* "View.MemoryView":211
8721  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8722  *
8723  * def __dealloc__(array self): # <<<<<<<<<<<<<<
8724  * if self.callback_free_data != NULL:
8725  * self.callback_free_data(self.data)
8726  */
8727 
8728 /* Python wrapper */
8729 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
8730 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
8731  __Pyx_RefNannyDeclarations
8732  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
8733  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
8734 
8735  /* function exit code */
8736  __Pyx_RefNannyFinishContext();
8737 }
8738 
8739 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
8740  __Pyx_TraceDeclarations
8741  __Pyx_RefNannyDeclarations
8742  int __pyx_t_1;
8743  int __pyx_lineno = 0;
8744  const char *__pyx_filename = NULL;
8745  int __pyx_clineno = 0;
8746  __Pyx_RefNannySetupContext("__dealloc__", 0);
8747  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 211, 0, __PYX_ERR(1, 211, __pyx_L1_error));
8748 
8749  /* "View.MemoryView":212
8750  *
8751  * def __dealloc__(array self):
8752  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
8753  * self.callback_free_data(self.data)
8754  * elif self.free_data:
8755  */
8756  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
8757  if (__pyx_t_1) {
8758 
8759  /* "View.MemoryView":213
8760  * def __dealloc__(array self):
8761  * if self.callback_free_data != NULL:
8762  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
8763  * elif self.free_data:
8764  * if self.dtype_is_object:
8765  */
8766  __pyx_v_self->callback_free_data(__pyx_v_self->data);
8767 
8768  /* "View.MemoryView":212
8769  *
8770  * def __dealloc__(array self):
8771  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
8772  * self.callback_free_data(self.data)
8773  * elif self.free_data:
8774  */
8775  goto __pyx_L3;
8776  }
8777 
8778  /* "View.MemoryView":214
8779  * if self.callback_free_data != NULL:
8780  * self.callback_free_data(self.data)
8781  * elif self.free_data: # <<<<<<<<<<<<<<
8782  * if self.dtype_is_object:
8783  * refcount_objects_in_slice(self.data, self._shape,
8784  */
8785  __pyx_t_1 = (__pyx_v_self->free_data != 0);
8786  if (__pyx_t_1) {
8787 
8788  /* "View.MemoryView":215
8789  * self.callback_free_data(self.data)
8790  * elif self.free_data:
8791  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8792  * refcount_objects_in_slice(self.data, self._shape,
8793  * self._strides, self.ndim, False)
8794  */
8795  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
8796  if (__pyx_t_1) {
8797 
8798  /* "View.MemoryView":216
8799  * elif self.free_data:
8800  * if self.dtype_is_object:
8801  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
8802  * self._strides, self.ndim, False)
8803  * free(self.data)
8804  */
8805  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
8806 
8807  /* "View.MemoryView":215
8808  * self.callback_free_data(self.data)
8809  * elif self.free_data:
8810  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8811  * refcount_objects_in_slice(self.data, self._shape,
8812  * self._strides, self.ndim, False)
8813  */
8814  }
8815 
8816  /* "View.MemoryView":218
8817  * refcount_objects_in_slice(self.data, self._shape,
8818  * self._strides, self.ndim, False)
8819  * free(self.data) # <<<<<<<<<<<<<<
8820  * PyObject_Free(self._shape)
8821  *
8822  */
8823  free(__pyx_v_self->data);
8824 
8825  /* "View.MemoryView":214
8826  * if self.callback_free_data != NULL:
8827  * self.callback_free_data(self.data)
8828  * elif self.free_data: # <<<<<<<<<<<<<<
8829  * if self.dtype_is_object:
8830  * refcount_objects_in_slice(self.data, self._shape,
8831  */
8832  }
8833  __pyx_L3:;
8834 
8835  /* "View.MemoryView":219
8836  * self._strides, self.ndim, False)
8837  * free(self.data)
8838  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
8839  *
8840  * @property
8841  */
8842  PyObject_Free(__pyx_v_self->_shape);
8843 
8844  /* "View.MemoryView":211
8845  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8846  *
8847  * def __dealloc__(array self): # <<<<<<<<<<<<<<
8848  * if self.callback_free_data != NULL:
8849  * self.callback_free_data(self.data)
8850  */
8851 
8852  /* function exit code */
8853  goto __pyx_L0;
8854  __pyx_L1_error:;
8855  __Pyx_WriteUnraisable("View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
8856  __pyx_L0:;
8857  __Pyx_TraceReturn(Py_None, 0);
8858  __Pyx_RefNannyFinishContext();
8859 }
8860 
8861 /* "View.MemoryView":222
8862  *
8863  * @property
8864  * def memview(self): # <<<<<<<<<<<<<<
8865  * return self.get_memview()
8866  *
8867  */
8868 
8869 /* Python wrapper */
8870 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
8871 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
8872  PyObject *__pyx_r = 0;
8873  __Pyx_RefNannyDeclarations
8874  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
8875  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
8876 
8877  /* function exit code */
8878  __Pyx_RefNannyFinishContext();
8879  return __pyx_r;
8880 }
8881 
8882 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
8883  PyObject *__pyx_r = NULL;
8884  __Pyx_TraceDeclarations
8885  __Pyx_RefNannyDeclarations
8886  PyObject *__pyx_t_1 = NULL;
8887  int __pyx_lineno = 0;
8888  const char *__pyx_filename = NULL;
8889  int __pyx_clineno = 0;
8890  __Pyx_RefNannySetupContext("__get__", 0);
8891  __Pyx_TraceCall("__get__", __pyx_f[1], 222, 0, __PYX_ERR(1, 222, __pyx_L1_error));
8892 
8893  /* "View.MemoryView":223
8894  * @property
8895  * def memview(self):
8896  * return self.get_memview() # <<<<<<<<<<<<<<
8897  *
8898  * @cname('get_memview')
8899  */
8900  __Pyx_XDECREF(__pyx_r);
8901  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
8902  __Pyx_GOTREF(__pyx_t_1);
8903  __pyx_r = __pyx_t_1;
8904  __pyx_t_1 = 0;
8905  goto __pyx_L0;
8906 
8907  /* "View.MemoryView":222
8908  *
8909  * @property
8910  * def memview(self): # <<<<<<<<<<<<<<
8911  * return self.get_memview()
8912  *
8913  */
8914 
8915  /* function exit code */
8916  __pyx_L1_error:;
8917  __Pyx_XDECREF(__pyx_t_1);
8918  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8919  __pyx_r = NULL;
8920  __pyx_L0:;
8921  __Pyx_XGIVEREF(__pyx_r);
8922  __Pyx_TraceReturn(__pyx_r, 0);
8923  __Pyx_RefNannyFinishContext();
8924  return __pyx_r;
8925 }
8926 
8927 /* "View.MemoryView":226
8928  *
8929  * @cname('get_memview')
8930  * cdef get_memview(self): # <<<<<<<<<<<<<<
8931  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
8932  * return memoryview(self, flags, self.dtype_is_object)
8933  */
8934 
8935 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
8936  int __pyx_v_flags;
8937  PyObject *__pyx_r = NULL;
8938  __Pyx_TraceDeclarations
8939  __Pyx_RefNannyDeclarations
8940  PyObject *__pyx_t_1 = NULL;
8941  PyObject *__pyx_t_2 = NULL;
8942  PyObject *__pyx_t_3 = NULL;
8943  int __pyx_lineno = 0;
8944  const char *__pyx_filename = NULL;
8945  int __pyx_clineno = 0;
8946  __Pyx_RefNannySetupContext("get_memview", 0);
8947  __Pyx_TraceCall("get_memview", __pyx_f[1], 226, 0, __PYX_ERR(1, 226, __pyx_L1_error));
8948 
8949  /* "View.MemoryView":227
8950  * @cname('get_memview')
8951  * cdef get_memview(self):
8952  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
8953  * return memoryview(self, flags, self.dtype_is_object)
8954  *
8955  */
8956  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
8957 
8958  /* "View.MemoryView":228
8959  * cdef get_memview(self):
8960  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
8961  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
8962  *
8963  * def __len__(self):
8964  */
8965  __Pyx_XDECREF(__pyx_r);
8966  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
8967  __Pyx_GOTREF(__pyx_t_1);
8968  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
8969  __Pyx_GOTREF(__pyx_t_2);
8970  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
8971  __Pyx_GOTREF(__pyx_t_3);
8972  __Pyx_INCREF(((PyObject *)__pyx_v_self));
8973  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8974  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
8975  __Pyx_GIVEREF(__pyx_t_1);
8976  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
8977  __Pyx_GIVEREF(__pyx_t_2);
8978  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
8979  __pyx_t_1 = 0;
8980  __pyx_t_2 = 0;
8981  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
8982  __Pyx_GOTREF(__pyx_t_2);
8983  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8984  __pyx_r = __pyx_t_2;
8985  __pyx_t_2 = 0;
8986  goto __pyx_L0;
8987 
8988  /* "View.MemoryView":226
8989  *
8990  * @cname('get_memview')
8991  * cdef get_memview(self): # <<<<<<<<<<<<<<
8992  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
8993  * return memoryview(self, flags, self.dtype_is_object)
8994  */
8995 
8996  /* function exit code */
8997  __pyx_L1_error:;
8998  __Pyx_XDECREF(__pyx_t_1);
8999  __Pyx_XDECREF(__pyx_t_2);
9000  __Pyx_XDECREF(__pyx_t_3);
9001  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
9002  __pyx_r = 0;
9003  __pyx_L0:;
9004  __Pyx_XGIVEREF(__pyx_r);
9005  __Pyx_TraceReturn(__pyx_r, 0);
9006  __Pyx_RefNannyFinishContext();
9007  return __pyx_r;
9008 }
9009 
9010 /* "View.MemoryView":230
9011  * return memoryview(self, flags, self.dtype_is_object)
9012  *
9013  * def __len__(self): # <<<<<<<<<<<<<<
9014  * return self._shape[0]
9015  *
9016  */
9017 
9018 /* Python wrapper */
9019 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
9020 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
9021  Py_ssize_t __pyx_r;
9022  __Pyx_RefNannyDeclarations
9023  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
9024  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
9025 
9026  /* function exit code */
9027  __Pyx_RefNannyFinishContext();
9028  return __pyx_r;
9029 }
9030 
9031 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
9032  Py_ssize_t __pyx_r;
9033  __Pyx_TraceDeclarations
9034  __Pyx_RefNannyDeclarations
9035  int __pyx_lineno = 0;
9036  const char *__pyx_filename = NULL;
9037  int __pyx_clineno = 0;
9038  __Pyx_RefNannySetupContext("__len__", 0);
9039  __Pyx_TraceCall("__len__", __pyx_f[1], 230, 0, __PYX_ERR(1, 230, __pyx_L1_error));
9040 
9041  /* "View.MemoryView":231
9042  *
9043  * def __len__(self):
9044  * return self._shape[0] # <<<<<<<<<<<<<<
9045  *
9046  * def __getattr__(self, attr):
9047  */
9048  __pyx_r = (__pyx_v_self->_shape[0]);
9049  goto __pyx_L0;
9050 
9051  /* "View.MemoryView":230
9052  * return memoryview(self, flags, self.dtype_is_object)
9053  *
9054  * def __len__(self): # <<<<<<<<<<<<<<
9055  * return self._shape[0]
9056  *
9057  */
9058 
9059  /* function exit code */
9060  __pyx_L1_error:;
9061  __Pyx_AddTraceback("View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9062  __pyx_r = -1;
9063  __pyx_L0:;
9064  __Pyx_TraceReturn(Py_None, 0);
9065  __Pyx_RefNannyFinishContext();
9066  return __pyx_r;
9067 }
9068 
9069 /* "View.MemoryView":233
9070  * return self._shape[0]
9071  *
9072  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9073  * return getattr(self.memview, attr)
9074  *
9075  */
9076 
9077 /* Python wrapper */
9078 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
9079 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
9080  PyObject *__pyx_r = 0;
9081  __Pyx_RefNannyDeclarations
9082  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
9083  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
9084 
9085  /* function exit code */
9086  __Pyx_RefNannyFinishContext();
9087  return __pyx_r;
9088 }
9089 
9090 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
9091  PyObject *__pyx_r = NULL;
9092  __Pyx_TraceDeclarations
9093  __Pyx_RefNannyDeclarations
9094  PyObject *__pyx_t_1 = NULL;
9095  PyObject *__pyx_t_2 = NULL;
9096  int __pyx_lineno = 0;
9097  const char *__pyx_filename = NULL;
9098  int __pyx_clineno = 0;
9099  __Pyx_RefNannySetupContext("__getattr__", 0);
9100  __Pyx_TraceCall("__getattr__", __pyx_f[1], 233, 0, __PYX_ERR(1, 233, __pyx_L1_error));
9101 
9102  /* "View.MemoryView":234
9103  *
9104  * def __getattr__(self, attr):
9105  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
9106  *
9107  * def __getitem__(self, item):
9108  */
9109  __Pyx_XDECREF(__pyx_r);
9110  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
9111  __Pyx_GOTREF(__pyx_t_1);
9112  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
9113  __Pyx_GOTREF(__pyx_t_2);
9114  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9115  __pyx_r = __pyx_t_2;
9116  __pyx_t_2 = 0;
9117  goto __pyx_L0;
9118 
9119  /* "View.MemoryView":233
9120  * return self._shape[0]
9121  *
9122  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9123  * return getattr(self.memview, attr)
9124  *
9125  */
9126 
9127  /* function exit code */
9128  __pyx_L1_error:;
9129  __Pyx_XDECREF(__pyx_t_1);
9130  __Pyx_XDECREF(__pyx_t_2);
9131  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9132  __pyx_r = NULL;
9133  __pyx_L0:;
9134  __Pyx_XGIVEREF(__pyx_r);
9135  __Pyx_TraceReturn(__pyx_r, 0);
9136  __Pyx_RefNannyFinishContext();
9137  return __pyx_r;
9138 }
9139 
9140 /* "View.MemoryView":236
9141  * return getattr(self.memview, attr)
9142  *
9143  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9144  * return self.memview[item]
9145  *
9146  */
9147 
9148 /* Python wrapper */
9149 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
9150 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
9151  PyObject *__pyx_r = 0;
9152  __Pyx_RefNannyDeclarations
9153  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
9154  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
9155 
9156  /* function exit code */
9157  __Pyx_RefNannyFinishContext();
9158  return __pyx_r;
9159 }
9160 
9161 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
9162  PyObject *__pyx_r = NULL;
9163  __Pyx_TraceDeclarations
9164  __Pyx_RefNannyDeclarations
9165  PyObject *__pyx_t_1 = NULL;
9166  PyObject *__pyx_t_2 = NULL;
9167  int __pyx_lineno = 0;
9168  const char *__pyx_filename = NULL;
9169  int __pyx_clineno = 0;
9170  __Pyx_RefNannySetupContext("__getitem__", 0);
9171  __Pyx_TraceCall("__getitem__", __pyx_f[1], 236, 0, __PYX_ERR(1, 236, __pyx_L1_error));
9172 
9173  /* "View.MemoryView":237
9174  *
9175  * def __getitem__(self, item):
9176  * return self.memview[item] # <<<<<<<<<<<<<<
9177  *
9178  * def __setitem__(self, item, value):
9179  */
9180  __Pyx_XDECREF(__pyx_r);
9181  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
9182  __Pyx_GOTREF(__pyx_t_1);
9183  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
9184  __Pyx_GOTREF(__pyx_t_2);
9185  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9186  __pyx_r = __pyx_t_2;
9187  __pyx_t_2 = 0;
9188  goto __pyx_L0;
9189 
9190  /* "View.MemoryView":236
9191  * return getattr(self.memview, attr)
9192  *
9193  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9194  * return self.memview[item]
9195  *
9196  */
9197 
9198  /* function exit code */
9199  __pyx_L1_error:;
9200  __Pyx_XDECREF(__pyx_t_1);
9201  __Pyx_XDECREF(__pyx_t_2);
9202  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9203  __pyx_r = NULL;
9204  __pyx_L0:;
9205  __Pyx_XGIVEREF(__pyx_r);
9206  __Pyx_TraceReturn(__pyx_r, 0);
9207  __Pyx_RefNannyFinishContext();
9208  return __pyx_r;
9209 }
9210 
9211 /* "View.MemoryView":239
9212  * return self.memview[item]
9213  *
9214  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9215  * self.memview[item] = value
9216  *
9217  */
9218 
9219 /* Python wrapper */
9220 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
9221 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9222  int __pyx_r;
9223  __Pyx_RefNannyDeclarations
9224  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
9225  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
9226 
9227  /* function exit code */
9228  __Pyx_RefNannyFinishContext();
9229  return __pyx_r;
9230 }
9231 
9232 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9233  int __pyx_r;
9234  __Pyx_TraceDeclarations
9235  __Pyx_RefNannyDeclarations
9236  PyObject *__pyx_t_1 = NULL;
9237  int __pyx_lineno = 0;
9238  const char *__pyx_filename = NULL;
9239  int __pyx_clineno = 0;
9240  __Pyx_RefNannySetupContext("__setitem__", 0);
9241  __Pyx_TraceCall("__setitem__", __pyx_f[1], 239, 0, __PYX_ERR(1, 239, __pyx_L1_error));
9242 
9243  /* "View.MemoryView":240
9244  *
9245  * def __setitem__(self, item, value):
9246  * self.memview[item] = value # <<<<<<<<<<<<<<
9247  *
9248  *
9249  */
9250  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
9251  __Pyx_GOTREF(__pyx_t_1);
9252  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
9253  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9254 
9255  /* "View.MemoryView":239
9256  * return self.memview[item]
9257  *
9258  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9259  * self.memview[item] = value
9260  *
9261  */
9262 
9263  /* function exit code */
9264  __pyx_r = 0;
9265  goto __pyx_L0;
9266  __pyx_L1_error:;
9267  __Pyx_XDECREF(__pyx_t_1);
9268  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9269  __pyx_r = -1;
9270  __pyx_L0:;
9271  __Pyx_TraceReturn(Py_None, 0);
9272  __Pyx_RefNannyFinishContext();
9273  return __pyx_r;
9274 }
9275 
9276 /* "(tree fragment)":1
9277  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9278  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9279  * def __setstate_cython__(self, __pyx_state):
9280  */
9281 
9282 /* Python wrapper */
9283 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9284 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
9285 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9286  PyObject *__pyx_r = 0;
9287  __Pyx_RefNannyDeclarations
9288  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9289  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
9290 
9291  /* function exit code */
9292  __Pyx_RefNannyFinishContext();
9293  return __pyx_r;
9294 }
9295 
9296 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
9297  PyObject *__pyx_r = NULL;
9298  __Pyx_TraceDeclarations
9299  __Pyx_RefNannyDeclarations
9300  PyObject *__pyx_t_1 = NULL;
9301  int __pyx_lineno = 0;
9302  const char *__pyx_filename = NULL;
9303  int __pyx_clineno = 0;
9304  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9305  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
9306 
9307  /* "(tree fragment)":2
9308  * def __reduce_cython__(self):
9309  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9310  * def __setstate_cython__(self, __pyx_state):
9311  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9312  */
9313  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
9314  __Pyx_GOTREF(__pyx_t_1);
9315  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9316  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9317  __PYX_ERR(1, 2, __pyx_L1_error)
9318 
9319  /* "(tree fragment)":1
9320  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9321  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9322  * def __setstate_cython__(self, __pyx_state):
9323  */
9324 
9325  /* function exit code */
9326  __pyx_L1_error:;
9327  __Pyx_XDECREF(__pyx_t_1);
9328  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9329  __pyx_r = NULL;
9330  __Pyx_XGIVEREF(__pyx_r);
9331  __Pyx_TraceReturn(__pyx_r, 0);
9332  __Pyx_RefNannyFinishContext();
9333  return __pyx_r;
9334 }
9335 
9336 /* "(tree fragment)":3
9337  * def __reduce_cython__(self):
9338  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9339  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9340  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9341  */
9342 
9343 /* Python wrapper */
9344 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
9345 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
9346 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9347  PyObject *__pyx_r = 0;
9348  __Pyx_RefNannyDeclarations
9349  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9350  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9351 
9352  /* function exit code */
9353  __Pyx_RefNannyFinishContext();
9354  return __pyx_r;
9355 }
9356 
9357 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
9358  PyObject *__pyx_r = NULL;
9359  __Pyx_TraceDeclarations
9360  __Pyx_RefNannyDeclarations
9361  PyObject *__pyx_t_1 = NULL;
9362  int __pyx_lineno = 0;
9363  const char *__pyx_filename = NULL;
9364  int __pyx_clineno = 0;
9365  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9366  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
9367 
9368  /* "(tree fragment)":4
9369  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9370  * def __setstate_cython__(self, __pyx_state):
9371  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9372  */
9373  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
9374  __Pyx_GOTREF(__pyx_t_1);
9375  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9376  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9377  __PYX_ERR(1, 4, __pyx_L1_error)
9378 
9379  /* "(tree fragment)":3
9380  * def __reduce_cython__(self):
9381  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9382  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9383  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9384  */
9385 
9386  /* function exit code */
9387  __pyx_L1_error:;
9388  __Pyx_XDECREF(__pyx_t_1);
9389  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9390  __pyx_r = NULL;
9391  __Pyx_XGIVEREF(__pyx_r);
9392  __Pyx_TraceReturn(__pyx_r, 0);
9393  __Pyx_RefNannyFinishContext();
9394  return __pyx_r;
9395 }
9396 
9397 /* "View.MemoryView":244
9398  *
9399  * @cname("__pyx_array_new")
9400  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
9401  * char *mode, char *buf):
9402  * cdef array result
9403  */
9404 
9405 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
9406  struct __pyx_array_obj *__pyx_v_result = 0;
9407  struct __pyx_array_obj *__pyx_r = NULL;
9408  __Pyx_TraceDeclarations
9409  __Pyx_RefNannyDeclarations
9410  int __pyx_t_1;
9411  PyObject *__pyx_t_2 = NULL;
9412  PyObject *__pyx_t_3 = NULL;
9413  PyObject *__pyx_t_4 = NULL;
9414  PyObject *__pyx_t_5 = NULL;
9415  int __pyx_lineno = 0;
9416  const char *__pyx_filename = NULL;
9417  int __pyx_clineno = 0;
9418  __Pyx_RefNannySetupContext("array_cwrapper", 0);
9419  __Pyx_TraceCall("array_cwrapper", __pyx_f[1], 244, 0, __PYX_ERR(1, 244, __pyx_L1_error));
9420 
9421  /* "View.MemoryView":248
9422  * cdef array result
9423  *
9424  * if buf == NULL: # <<<<<<<<<<<<<<
9425  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9426  * else:
9427  */
9428  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
9429  if (__pyx_t_1) {
9430 
9431  /* "View.MemoryView":249
9432  *
9433  * if buf == NULL:
9434  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
9435  * else:
9436  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9437  */
9438  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
9439  __Pyx_GOTREF(__pyx_t_2);
9440  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
9441  __Pyx_GOTREF(__pyx_t_3);
9442  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
9443  __Pyx_GOTREF(__pyx_t_4);
9444  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
9445  __Pyx_GOTREF(__pyx_t_5);
9446  __Pyx_INCREF(__pyx_v_shape);
9447  __Pyx_GIVEREF(__pyx_v_shape);
9448  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
9449  __Pyx_GIVEREF(__pyx_t_2);
9450  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
9451  __Pyx_GIVEREF(__pyx_t_3);
9452  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
9453  __Pyx_GIVEREF(__pyx_t_4);
9454  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
9455  __pyx_t_2 = 0;
9456  __pyx_t_3 = 0;
9457  __pyx_t_4 = 0;
9458  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
9459  __Pyx_GOTREF(__pyx_t_4);
9460  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9461  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
9462  __pyx_t_4 = 0;
9463 
9464  /* "View.MemoryView":248
9465  * cdef array result
9466  *
9467  * if buf == NULL: # <<<<<<<<<<<<<<
9468  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9469  * else:
9470  */
9471  goto __pyx_L3;
9472  }
9473 
9474  /* "View.MemoryView":251
9475  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9476  * else:
9477  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
9478  * allocate_buffer=False)
9479  * result.data = buf
9480  */
9481  /*else*/ {
9482  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
9483  __Pyx_GOTREF(__pyx_t_4);
9484  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
9485  __Pyx_GOTREF(__pyx_t_5);
9486  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
9487  __Pyx_GOTREF(__pyx_t_3);
9488  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
9489  __Pyx_GOTREF(__pyx_t_2);
9490  __Pyx_INCREF(__pyx_v_shape);
9491  __Pyx_GIVEREF(__pyx_v_shape);
9492  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
9493  __Pyx_GIVEREF(__pyx_t_4);
9494  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
9495  __Pyx_GIVEREF(__pyx_t_5);
9496  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
9497  __Pyx_GIVEREF(__pyx_t_3);
9498  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
9499  __pyx_t_4 = 0;
9500  __pyx_t_5 = 0;
9501  __pyx_t_3 = 0;
9502 
9503  /* "View.MemoryView":252
9504  * else:
9505  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9506  * allocate_buffer=False) # <<<<<<<<<<<<<<
9507  * result.data = buf
9508  *
9509  */
9510  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
9511  __Pyx_GOTREF(__pyx_t_3);
9512  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
9513 
9514  /* "View.MemoryView":251
9515  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9516  * else:
9517  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
9518  * allocate_buffer=False)
9519  * result.data = buf
9520  */
9521  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
9522  __Pyx_GOTREF(__pyx_t_5);
9523  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9524  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9525  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
9526  __pyx_t_5 = 0;
9527 
9528  /* "View.MemoryView":253
9529  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9530  * allocate_buffer=False)
9531  * result.data = buf # <<<<<<<<<<<<<<
9532  *
9533  * return result
9534  */
9535  __pyx_v_result->data = __pyx_v_buf;
9536  }
9537  __pyx_L3:;
9538 
9539  /* "View.MemoryView":255
9540  * result.data = buf
9541  *
9542  * return result # <<<<<<<<<<<<<<
9543  *
9544  *
9545  */
9546  __Pyx_XDECREF(((PyObject *)__pyx_r));
9547  __Pyx_INCREF(((PyObject *)__pyx_v_result));
9548  __pyx_r = __pyx_v_result;
9549  goto __pyx_L0;
9550 
9551  /* "View.MemoryView":244
9552  *
9553  * @cname("__pyx_array_new")
9554  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
9555  * char *mode, char *buf):
9556  * cdef array result
9557  */
9558 
9559  /* function exit code */
9560  __pyx_L1_error:;
9561  __Pyx_XDECREF(__pyx_t_2);
9562  __Pyx_XDECREF(__pyx_t_3);
9563  __Pyx_XDECREF(__pyx_t_4);
9564  __Pyx_XDECREF(__pyx_t_5);
9565  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
9566  __pyx_r = 0;
9567  __pyx_L0:;
9568  __Pyx_XDECREF((PyObject *)__pyx_v_result);
9569  __Pyx_XGIVEREF((PyObject *)__pyx_r);
9570  __Pyx_TraceReturn(__pyx_r, 0);
9571  __Pyx_RefNannyFinishContext();
9572  return __pyx_r;
9573 }
9574 
9575 /* "View.MemoryView":281
9576  * cdef class Enum(object):
9577  * cdef object name
9578  * def __init__(self, name): # <<<<<<<<<<<<<<
9579  * self.name = name
9580  * def __repr__(self):
9581  */
9582 
9583 /* Python wrapper */
9584 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9585 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9586  PyObject *__pyx_v_name = 0;
9587  int __pyx_lineno = 0;
9588  const char *__pyx_filename = NULL;
9589  int __pyx_clineno = 0;
9590  int __pyx_r;
9591  __Pyx_RefNannyDeclarations
9592  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
9593  {
9594  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
9595  PyObject* values[1] = {0};
9596  if (unlikely(__pyx_kwds)) {
9597  Py_ssize_t kw_args;
9598  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9599  switch (pos_args) {
9600  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9601  CYTHON_FALLTHROUGH;
9602  case 0: break;
9603  default: goto __pyx_L5_argtuple_error;
9604  }
9605  kw_args = PyDict_Size(__pyx_kwds);
9606  switch (pos_args) {
9607  case 0:
9608  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
9609  else goto __pyx_L5_argtuple_error;
9610  }
9611  if (unlikely(kw_args > 0)) {
9612  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
9613  }
9614  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9615  goto __pyx_L5_argtuple_error;
9616  } else {
9617  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9618  }
9619  __pyx_v_name = values[0];
9620  }
9621  goto __pyx_L4_argument_unpacking_done;
9622  __pyx_L5_argtuple_error:;
9623  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
9624  __pyx_L3_error:;
9625  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9626  __Pyx_RefNannyFinishContext();
9627  return -1;
9628  __pyx_L4_argument_unpacking_done:;
9629  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
9630 
9631  /* function exit code */
9632  __Pyx_RefNannyFinishContext();
9633  return __pyx_r;
9634 }
9635 
9636 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
9637  int __pyx_r;
9638  __Pyx_TraceDeclarations
9639  __Pyx_RefNannyDeclarations
9640  int __pyx_lineno = 0;
9641  const char *__pyx_filename = NULL;
9642  int __pyx_clineno = 0;
9643  __Pyx_RefNannySetupContext("__init__", 0);
9644  __Pyx_TraceCall("__init__", __pyx_f[1], 281, 0, __PYX_ERR(1, 281, __pyx_L1_error));
9645 
9646  /* "View.MemoryView":282
9647  * cdef object name
9648  * def __init__(self, name):
9649  * self.name = name # <<<<<<<<<<<<<<
9650  * def __repr__(self):
9651  * return self.name
9652  */
9653  __Pyx_INCREF(__pyx_v_name);
9654  __Pyx_GIVEREF(__pyx_v_name);
9655  __Pyx_GOTREF(__pyx_v_self->name);
9656  __Pyx_DECREF(__pyx_v_self->name);
9657  __pyx_v_self->name = __pyx_v_name;
9658 
9659  /* "View.MemoryView":281
9660  * cdef class Enum(object):
9661  * cdef object name
9662  * def __init__(self, name): # <<<<<<<<<<<<<<
9663  * self.name = name
9664  * def __repr__(self):
9665  */
9666 
9667  /* function exit code */
9668  __pyx_r = 0;
9669  goto __pyx_L0;
9670  __pyx_L1_error:;
9671  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9672  __pyx_r = -1;
9673  __pyx_L0:;
9674  __Pyx_TraceReturn(Py_None, 0);
9675  __Pyx_RefNannyFinishContext();
9676  return __pyx_r;
9677 }
9678 
9679 /* "View.MemoryView":283
9680  * def __init__(self, name):
9681  * self.name = name
9682  * def __repr__(self): # <<<<<<<<<<<<<<
9683  * return self.name
9684  *
9685  */
9686 
9687 /* Python wrapper */
9688 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
9689 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
9690  PyObject *__pyx_r = 0;
9691  __Pyx_RefNannyDeclarations
9692  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
9693  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9694 
9695  /* function exit code */
9696  __Pyx_RefNannyFinishContext();
9697  return __pyx_r;
9698 }
9699 
9700 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9701  PyObject *__pyx_r = NULL;
9702  __Pyx_TraceDeclarations
9703  __Pyx_RefNannyDeclarations
9704  int __pyx_lineno = 0;
9705  const char *__pyx_filename = NULL;
9706  int __pyx_clineno = 0;
9707  __Pyx_RefNannySetupContext("__repr__", 0);
9708  __Pyx_TraceCall("__repr__", __pyx_f[1], 283, 0, __PYX_ERR(1, 283, __pyx_L1_error));
9709 
9710  /* "View.MemoryView":284
9711  * self.name = name
9712  * def __repr__(self):
9713  * return self.name # <<<<<<<<<<<<<<
9714  *
9715  * cdef generic = Enum("<strided and direct or indirect>")
9716  */
9717  __Pyx_XDECREF(__pyx_r);
9718  __Pyx_INCREF(__pyx_v_self->name);
9719  __pyx_r = __pyx_v_self->name;
9720  goto __pyx_L0;
9721 
9722  /* "View.MemoryView":283
9723  * def __init__(self, name):
9724  * self.name = name
9725  * def __repr__(self): # <<<<<<<<<<<<<<
9726  * return self.name
9727  *
9728  */
9729 
9730  /* function exit code */
9731  __pyx_L1_error:;
9732  __Pyx_AddTraceback("View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9733  __pyx_r = NULL;
9734  __pyx_L0:;
9735  __Pyx_XGIVEREF(__pyx_r);
9736  __Pyx_TraceReturn(__pyx_r, 0);
9737  __Pyx_RefNannyFinishContext();
9738  return __pyx_r;
9739 }
9740 
9741 /* "(tree fragment)":1
9742  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9743  * cdef tuple state
9744  * cdef object _dict
9745  */
9746 
9747 /* Python wrapper */
9748 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9749 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
9750 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9751  PyObject *__pyx_r = 0;
9752  __Pyx_RefNannyDeclarations
9753  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9754  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9755 
9756  /* function exit code */
9757  __Pyx_RefNannyFinishContext();
9758  return __pyx_r;
9759 }
9760 
9761 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9762  PyObject *__pyx_v_state = 0;
9763  PyObject *__pyx_v__dict = 0;
9764  int __pyx_v_use_setstate;
9765  PyObject *__pyx_r = NULL;
9766  __Pyx_TraceDeclarations
9767  __Pyx_RefNannyDeclarations
9768  PyObject *__pyx_t_1 = NULL;
9769  int __pyx_t_2;
9770  int __pyx_t_3;
9771  PyObject *__pyx_t_4 = NULL;
9772  PyObject *__pyx_t_5 = NULL;
9773  int __pyx_lineno = 0;
9774  const char *__pyx_filename = NULL;
9775  int __pyx_clineno = 0;
9776  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9777  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
9778 
9779  /* "(tree fragment)":5
9780  * cdef object _dict
9781  * cdef bint use_setstate
9782  * state = (self.name,) # <<<<<<<<<<<<<<
9783  * _dict = getattr(self, '__dict__', None)
9784  * if _dict is not None:
9785  */
9786  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
9787  __Pyx_GOTREF(__pyx_t_1);
9788  __Pyx_INCREF(__pyx_v_self->name);
9789  __Pyx_GIVEREF(__pyx_v_self->name);
9790  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
9791  __pyx_v_state = ((PyObject*)__pyx_t_1);
9792  __pyx_t_1 = 0;
9793 
9794  /* "(tree fragment)":6
9795  * cdef bint use_setstate
9796  * state = (self.name,)
9797  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
9798  * if _dict is not None:
9799  * state += (_dict,)
9800  */
9801  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
9802  __Pyx_GOTREF(__pyx_t_1);
9803  __pyx_v__dict = __pyx_t_1;
9804  __pyx_t_1 = 0;
9805 
9806  /* "(tree fragment)":7
9807  * state = (self.name,)
9808  * _dict = getattr(self, '__dict__', None)
9809  * if _dict is not None: # <<<<<<<<<<<<<<
9810  * state += (_dict,)
9811  * use_setstate = True
9812  */
9813  __pyx_t_2 = (__pyx_v__dict != Py_None);
9814  __pyx_t_3 = (__pyx_t_2 != 0);
9815  if (__pyx_t_3) {
9816 
9817  /* "(tree fragment)":8
9818  * _dict = getattr(self, '__dict__', None)
9819  * if _dict is not None:
9820  * state += (_dict,) # <<<<<<<<<<<<<<
9821  * use_setstate = True
9822  * else:
9823  */
9824  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
9825  __Pyx_GOTREF(__pyx_t_1);
9826  __Pyx_INCREF(__pyx_v__dict);
9827  __Pyx_GIVEREF(__pyx_v__dict);
9828  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
9829  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
9830  __Pyx_GOTREF(__pyx_t_4);
9831  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9832  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
9833  __pyx_t_4 = 0;
9834 
9835  /* "(tree fragment)":9
9836  * if _dict is not None:
9837  * state += (_dict,)
9838  * use_setstate = True # <<<<<<<<<<<<<<
9839  * else:
9840  * use_setstate = self.name is not None
9841  */
9842  __pyx_v_use_setstate = 1;
9843 
9844  /* "(tree fragment)":7
9845  * state = (self.name,)
9846  * _dict = getattr(self, '__dict__', None)
9847  * if _dict is not None: # <<<<<<<<<<<<<<
9848  * state += (_dict,)
9849  * use_setstate = True
9850  */
9851  goto __pyx_L3;
9852  }
9853 
9854  /* "(tree fragment)":11
9855  * use_setstate = True
9856  * else:
9857  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
9858  * if use_setstate:
9859  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9860  */
9861  /*else*/ {
9862  __pyx_t_3 = (__pyx_v_self->name != Py_None);
9863  __pyx_v_use_setstate = __pyx_t_3;
9864  }
9865  __pyx_L3:;
9866 
9867  /* "(tree fragment)":12
9868  * else:
9869  * use_setstate = self.name is not None
9870  * if use_setstate: # <<<<<<<<<<<<<<
9871  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9872  * else:
9873  */
9874  __pyx_t_3 = (__pyx_v_use_setstate != 0);
9875  if (__pyx_t_3) {
9876 
9877  /* "(tree fragment)":13
9878  * use_setstate = self.name is not None
9879  * if use_setstate:
9880  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
9881  * else:
9882  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9883  */
9884  __Pyx_XDECREF(__pyx_r);
9885  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
9886  __Pyx_GOTREF(__pyx_t_4);
9887  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
9888  __Pyx_GOTREF(__pyx_t_1);
9889  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9890  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9891  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9892  __Pyx_INCREF(__pyx_int_184977713);
9893  __Pyx_GIVEREF(__pyx_int_184977713);
9894  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9895  __Pyx_INCREF(Py_None);
9896  __Pyx_GIVEREF(Py_None);
9897  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
9898  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
9899  __Pyx_GOTREF(__pyx_t_5);
9900  __Pyx_GIVEREF(__pyx_t_4);
9901  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
9902  __Pyx_GIVEREF(__pyx_t_1);
9903  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
9904  __Pyx_INCREF(__pyx_v_state);
9905  __Pyx_GIVEREF(__pyx_v_state);
9906  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
9907  __pyx_t_4 = 0;
9908  __pyx_t_1 = 0;
9909  __pyx_r = __pyx_t_5;
9910  __pyx_t_5 = 0;
9911  goto __pyx_L0;
9912 
9913  /* "(tree fragment)":12
9914  * else:
9915  * use_setstate = self.name is not None
9916  * if use_setstate: # <<<<<<<<<<<<<<
9917  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9918  * else:
9919  */
9920  }
9921 
9922  /* "(tree fragment)":15
9923  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9924  * else:
9925  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
9926  * def __setstate_cython__(self, __pyx_state):
9927  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
9928  */
9929  /*else*/ {
9930  __Pyx_XDECREF(__pyx_r);
9931  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
9932  __Pyx_GOTREF(__pyx_t_5);
9933  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
9934  __Pyx_GOTREF(__pyx_t_1);
9935  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9936  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9937  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9938  __Pyx_INCREF(__pyx_int_184977713);
9939  __Pyx_GIVEREF(__pyx_int_184977713);
9940  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9941  __Pyx_INCREF(__pyx_v_state);
9942  __Pyx_GIVEREF(__pyx_v_state);
9943  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
9944  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
9945  __Pyx_GOTREF(__pyx_t_4);
9946  __Pyx_GIVEREF(__pyx_t_5);
9947  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
9948  __Pyx_GIVEREF(__pyx_t_1);
9949  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
9950  __pyx_t_5 = 0;
9951  __pyx_t_1 = 0;
9952  __pyx_r = __pyx_t_4;
9953  __pyx_t_4 = 0;
9954  goto __pyx_L0;
9955  }
9956 
9957  /* "(tree fragment)":1
9958  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9959  * cdef tuple state
9960  * cdef object _dict
9961  */
9962 
9963  /* function exit code */
9964  __pyx_L1_error:;
9965  __Pyx_XDECREF(__pyx_t_1);
9966  __Pyx_XDECREF(__pyx_t_4);
9967  __Pyx_XDECREF(__pyx_t_5);
9968  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9969  __pyx_r = NULL;
9970  __pyx_L0:;
9971  __Pyx_XDECREF(__pyx_v_state);
9972  __Pyx_XDECREF(__pyx_v__dict);
9973  __Pyx_XGIVEREF(__pyx_r);
9974  __Pyx_TraceReturn(__pyx_r, 0);
9975  __Pyx_RefNannyFinishContext();
9976  return __pyx_r;
9977 }
9978 
9979 /* "(tree fragment)":16
9980  * else:
9981  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9982  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9983  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
9984  */
9985 
9986 /* Python wrapper */
9987 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
9988 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
9989 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9990  PyObject *__pyx_r = 0;
9991  __Pyx_RefNannyDeclarations
9992  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9993  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9994 
9995  /* function exit code */
9996  __Pyx_RefNannyFinishContext();
9997  return __pyx_r;
9998 }
9999 
10000 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10001  PyObject *__pyx_r = NULL;
10002  __Pyx_TraceDeclarations
10003  __Pyx_RefNannyDeclarations
10004  PyObject *__pyx_t_1 = NULL;
10005  int __pyx_lineno = 0;
10006  const char *__pyx_filename = NULL;
10007  int __pyx_clineno = 0;
10008  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10009  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
10010 
10011  /* "(tree fragment)":17
10012  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10013  * def __setstate_cython__(self, __pyx_state):
10014  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
10015  */
10016  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
10017  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
10018  __Pyx_GOTREF(__pyx_t_1);
10019  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10020 
10021  /* "(tree fragment)":16
10022  * else:
10023  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10024  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10025  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10026  */
10027 
10028  /* function exit code */
10029  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10030  goto __pyx_L0;
10031  __pyx_L1_error:;
10032  __Pyx_XDECREF(__pyx_t_1);
10033  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10034  __pyx_r = NULL;
10035  __pyx_L0:;
10036  __Pyx_XGIVEREF(__pyx_r);
10037  __Pyx_TraceReturn(__pyx_r, 0);
10038  __Pyx_RefNannyFinishContext();
10039  return __pyx_r;
10040 }
10041 
10042 /* "View.MemoryView":298
10043  *
10044  * @cname('__pyx_align_pointer')
10045  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10046  * "Align pointer memory on a given boundary"
10047  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10048  */
10049 
10050 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
10051  Py_intptr_t __pyx_v_aligned_p;
10052  size_t __pyx_v_offset;
10053  void *__pyx_r;
10054  __Pyx_TraceDeclarations
10055  int __pyx_t_1;
10056  int __pyx_lineno = 0;
10057  const char *__pyx_filename = NULL;
10058  int __pyx_clineno = 0;
10059  __Pyx_TraceCall("align_pointer", __pyx_f[1], 298, 1, __PYX_ERR(1, 298, __pyx_L1_error));
10060 
10061  /* "View.MemoryView":300
10062  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
10063  * "Align pointer memory on a given boundary"
10064  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
10065  * cdef size_t offset
10066  *
10067  */
10068  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
10069 
10070  /* "View.MemoryView":304
10071  *
10072  * with cython.cdivision(True):
10073  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
10074  *
10075  * if offset > 0:
10076  */
10077  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
10078 
10079  /* "View.MemoryView":306
10080  * offset = aligned_p % alignment
10081  *
10082  * if offset > 0: # <<<<<<<<<<<<<<
10083  * aligned_p += alignment - offset
10084  *
10085  */
10086  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
10087  if (__pyx_t_1) {
10088 
10089  /* "View.MemoryView":307
10090  *
10091  * if offset > 0:
10092  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
10093  *
10094  * return <void *> aligned_p
10095  */
10096  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
10097 
10098  /* "View.MemoryView":306
10099  * offset = aligned_p % alignment
10100  *
10101  * if offset > 0: # <<<<<<<<<<<<<<
10102  * aligned_p += alignment - offset
10103  *
10104  */
10105  }
10106 
10107  /* "View.MemoryView":309
10108  * aligned_p += alignment - offset
10109  *
10110  * return <void *> aligned_p # <<<<<<<<<<<<<<
10111  *
10112  *
10113  */
10114  __pyx_r = ((void *)__pyx_v_aligned_p);
10115  goto __pyx_L0;
10116 
10117  /* "View.MemoryView":298
10118  *
10119  * @cname('__pyx_align_pointer')
10120  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10121  * "Align pointer memory on a given boundary"
10122  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10123  */
10124 
10125  /* function exit code */
10126  __pyx_L1_error:;
10127  __Pyx_WriteUnraisable("View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
10128  __pyx_r = 0;
10129  __pyx_L0:;
10130  __Pyx_TraceReturn(Py_None, 1);
10131  return __pyx_r;
10132 }
10133 
10134 /* "View.MemoryView":345
10135  * cdef __Pyx_TypeInfo *typeinfo
10136  *
10137  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
10138  * self.obj = obj
10139  * self.flags = flags
10140  */
10141 
10142 /* Python wrapper */
10143 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10144 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10145  PyObject *__pyx_v_obj = 0;
10146  int __pyx_v_flags;
10147  int __pyx_v_dtype_is_object;
10148  int __pyx_lineno = 0;
10149  const char *__pyx_filename = NULL;
10150  int __pyx_clineno = 0;
10151  int __pyx_r;
10152  __Pyx_RefNannyDeclarations
10153  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
10154  {
10155  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
10156  PyObject* values[3] = {0,0,0};
10157  if (unlikely(__pyx_kwds)) {
10158  Py_ssize_t kw_args;
10159  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10160  switch (pos_args) {
10161  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10162  CYTHON_FALLTHROUGH;
10163  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10164  CYTHON_FALLTHROUGH;
10165  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10166  CYTHON_FALLTHROUGH;
10167  case 0: break;
10168  default: goto __pyx_L5_argtuple_error;
10169  }
10170  kw_args = PyDict_Size(__pyx_kwds);
10171  switch (pos_args) {
10172  case 0:
10173  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
10174  else goto __pyx_L5_argtuple_error;
10175  CYTHON_FALLTHROUGH;
10176  case 1:
10177  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
10178  else {
10179  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
10180  }
10181  CYTHON_FALLTHROUGH;
10182  case 2:
10183  if (kw_args > 0) {
10184  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
10185  if (value) { values[2] = value; kw_args--; }
10186  }
10187  }
10188  if (unlikely(kw_args > 0)) {
10189  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
10190  }
10191  } else {
10192  switch (PyTuple_GET_SIZE(__pyx_args)) {
10193  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10194  CYTHON_FALLTHROUGH;
10195  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10196  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10197  break;
10198  default: goto __pyx_L5_argtuple_error;
10199  }
10200  }
10201  __pyx_v_obj = values[0];
10202  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
10203  if (values[2]) {
10204  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
10205  } else {
10206  __pyx_v_dtype_is_object = ((int)0);
10207  }
10208  }
10209  goto __pyx_L4_argument_unpacking_done;
10210  __pyx_L5_argtuple_error:;
10211  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
10212  __pyx_L3_error:;
10213  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10214  __Pyx_RefNannyFinishContext();
10215  return -1;
10216  __pyx_L4_argument_unpacking_done:;
10217  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
10218 
10219  /* function exit code */
10220  __Pyx_RefNannyFinishContext();
10221  return __pyx_r;
10222 }
10223 
10224 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
10225  int __pyx_r;
10226  __Pyx_TraceDeclarations
10227  __Pyx_RefNannyDeclarations
10228  int __pyx_t_1;
10229  int __pyx_t_2;
10230  int __pyx_t_3;
10231  int __pyx_t_4;
10232  int __pyx_lineno = 0;
10233  const char *__pyx_filename = NULL;
10234  int __pyx_clineno = 0;
10235  __Pyx_RefNannySetupContext("__cinit__", 0);
10236  __Pyx_TraceCall("__cinit__", __pyx_f[1], 345, 0, __PYX_ERR(1, 345, __pyx_L1_error));
10237 
10238  /* "View.MemoryView":346
10239  *
10240  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10241  * self.obj = obj # <<<<<<<<<<<<<<
10242  * self.flags = flags
10243  * if type(self) is memoryview or obj is not None:
10244  */
10245  __Pyx_INCREF(__pyx_v_obj);
10246  __Pyx_GIVEREF(__pyx_v_obj);
10247  __Pyx_GOTREF(__pyx_v_self->obj);
10248  __Pyx_DECREF(__pyx_v_self->obj);
10249  __pyx_v_self->obj = __pyx_v_obj;
10250 
10251  /* "View.MemoryView":347
10252  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10253  * self.obj = obj
10254  * self.flags = flags # <<<<<<<<<<<<<<
10255  * if type(self) is memoryview or obj is not None:
10256  * __Pyx_GetBuffer(obj, &self.view, flags)
10257  */
10258  __pyx_v_self->flags = __pyx_v_flags;
10259 
10260  /* "View.MemoryView":348
10261  * self.obj = obj
10262  * self.flags = flags
10263  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10264  * __Pyx_GetBuffer(obj, &self.view, flags)
10265  * if <PyObject *> self.view.obj == NULL:
10266  */
10267  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
10268  __pyx_t_3 = (__pyx_t_2 != 0);
10269  if (!__pyx_t_3) {
10270  } else {
10271  __pyx_t_1 = __pyx_t_3;
10272  goto __pyx_L4_bool_binop_done;
10273  }
10274  __pyx_t_3 = (__pyx_v_obj != Py_None);
10275  __pyx_t_2 = (__pyx_t_3 != 0);
10276  __pyx_t_1 = __pyx_t_2;
10277  __pyx_L4_bool_binop_done:;
10278  if (__pyx_t_1) {
10279 
10280  /* "View.MemoryView":349
10281  * self.flags = flags
10282  * if type(self) is memoryview or obj is not None:
10283  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
10284  * if <PyObject *> self.view.obj == NULL:
10285  * (<__pyx_buffer *> &self.view).obj = Py_None
10286  */
10287  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
10288 
10289  /* "View.MemoryView":350
10290  * if type(self) is memoryview or obj is not None:
10291  * __Pyx_GetBuffer(obj, &self.view, flags)
10292  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10293  * (<__pyx_buffer *> &self.view).obj = Py_None
10294  * Py_INCREF(Py_None)
10295  */
10296  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
10297  if (__pyx_t_1) {
10298 
10299  /* "View.MemoryView":351
10300  * __Pyx_GetBuffer(obj, &self.view, flags)
10301  * if <PyObject *> self.view.obj == NULL:
10302  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
10303  * Py_INCREF(Py_None)
10304  *
10305  */
10306  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
10307 
10308  /* "View.MemoryView":352
10309  * if <PyObject *> self.view.obj == NULL:
10310  * (<__pyx_buffer *> &self.view).obj = Py_None
10311  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
10312  *
10313  * global __pyx_memoryview_thread_locks_used
10314  */
10315  Py_INCREF(Py_None);
10316 
10317  /* "View.MemoryView":350
10318  * if type(self) is memoryview or obj is not None:
10319  * __Pyx_GetBuffer(obj, &self.view, flags)
10320  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10321  * (<__pyx_buffer *> &self.view).obj = Py_None
10322  * Py_INCREF(Py_None)
10323  */
10324  }
10325 
10326  /* "View.MemoryView":348
10327  * self.obj = obj
10328  * self.flags = flags
10329  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10330  * __Pyx_GetBuffer(obj, &self.view, flags)
10331  * if <PyObject *> self.view.obj == NULL:
10332  */
10333  }
10334 
10335  /* "View.MemoryView":355
10336  *
10337  * global __pyx_memoryview_thread_locks_used
10338  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10339  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10340  * __pyx_memoryview_thread_locks_used += 1
10341  */
10342  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
10343  if (__pyx_t_1) {
10344 
10345  /* "View.MemoryView":356
10346  * global __pyx_memoryview_thread_locks_used
10347  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10348  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
10349  * __pyx_memoryview_thread_locks_used += 1
10350  * if self.lock is NULL:
10351  */
10352  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10353 
10354  /* "View.MemoryView":357
10355  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10356  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10357  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
10358  * if self.lock is NULL:
10359  * self.lock = PyThread_allocate_lock()
10360  */
10361  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
10362 
10363  /* "View.MemoryView":355
10364  *
10365  * global __pyx_memoryview_thread_locks_used
10366  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10367  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10368  * __pyx_memoryview_thread_locks_used += 1
10369  */
10370  }
10371 
10372  /* "View.MemoryView":358
10373  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10374  * __pyx_memoryview_thread_locks_used += 1
10375  * if self.lock is NULL: # <<<<<<<<<<<<<<
10376  * self.lock = PyThread_allocate_lock()
10377  * if self.lock is NULL:
10378  */
10379  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10380  if (__pyx_t_1) {
10381 
10382  /* "View.MemoryView":359
10383  * __pyx_memoryview_thread_locks_used += 1
10384  * if self.lock is NULL:
10385  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
10386  * if self.lock is NULL:
10387  * raise MemoryError
10388  */
10389  __pyx_v_self->lock = PyThread_allocate_lock();
10390 
10391  /* "View.MemoryView":360
10392  * if self.lock is NULL:
10393  * self.lock = PyThread_allocate_lock()
10394  * if self.lock is NULL: # <<<<<<<<<<<<<<
10395  * raise MemoryError
10396  *
10397  */
10398  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10399  if (unlikely(__pyx_t_1)) {
10400 
10401  /* "View.MemoryView":361
10402  * self.lock = PyThread_allocate_lock()
10403  * if self.lock is NULL:
10404  * raise MemoryError # <<<<<<<<<<<<<<
10405  *
10406  * if flags & PyBUF_FORMAT:
10407  */
10408  PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
10409 
10410  /* "View.MemoryView":360
10411  * if self.lock is NULL:
10412  * self.lock = PyThread_allocate_lock()
10413  * if self.lock is NULL: # <<<<<<<<<<<<<<
10414  * raise MemoryError
10415  *
10416  */
10417  }
10418 
10419  /* "View.MemoryView":358
10420  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10421  * __pyx_memoryview_thread_locks_used += 1
10422  * if self.lock is NULL: # <<<<<<<<<<<<<<
10423  * self.lock = PyThread_allocate_lock()
10424  * if self.lock is NULL:
10425  */
10426  }
10427 
10428  /* "View.MemoryView":363
10429  * raise MemoryError
10430  *
10431  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10432  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10433  * else:
10434  */
10435  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10436  if (__pyx_t_1) {
10437 
10438  /* "View.MemoryView":364
10439  *
10440  * if flags & PyBUF_FORMAT:
10441  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
10442  * else:
10443  * self.dtype_is_object = dtype_is_object
10444  */
10445  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
10446  if (__pyx_t_2) {
10447  } else {
10448  __pyx_t_1 = __pyx_t_2;
10449  goto __pyx_L11_bool_binop_done;
10450  }
10451  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
10452  __pyx_t_1 = __pyx_t_2;
10453  __pyx_L11_bool_binop_done:;
10454  __pyx_v_self->dtype_is_object = __pyx_t_1;
10455 
10456  /* "View.MemoryView":363
10457  * raise MemoryError
10458  *
10459  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10460  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10461  * else:
10462  */
10463  goto __pyx_L10;
10464  }
10465 
10466  /* "View.MemoryView":366
10467  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10468  * else:
10469  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
10470  *
10471  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
10472  */
10473  /*else*/ {
10474  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
10475  }
10476  __pyx_L10:;
10477 
10478  /* "View.MemoryView":368
10479  * self.dtype_is_object = dtype_is_object
10480  *
10481  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
10482  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
10483  * self.typeinfo = NULL
10484  */
10485  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
10486 
10487  /* "View.MemoryView":370
10488  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
10489  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
10490  * self.typeinfo = NULL # <<<<<<<<<<<<<<
10491  *
10492  * def __dealloc__(memoryview self):
10493  */
10494  __pyx_v_self->typeinfo = NULL;
10495 
10496  /* "View.MemoryView":345
10497  * cdef __Pyx_TypeInfo *typeinfo
10498  *
10499  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
10500  * self.obj = obj
10501  * self.flags = flags
10502  */
10503 
10504  /* function exit code */
10505  __pyx_r = 0;
10506  goto __pyx_L0;
10507  __pyx_L1_error:;
10508  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10509  __pyx_r = -1;
10510  __pyx_L0:;
10511  __Pyx_TraceReturn(Py_None, 0);
10512  __Pyx_RefNannyFinishContext();
10513  return __pyx_r;
10514 }
10515 
10516 /* "View.MemoryView":372
10517  * self.typeinfo = NULL
10518  *
10519  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
10520  * if self.obj is not None:
10521  * __Pyx_ReleaseBuffer(&self.view)
10522  */
10523 
10524 /* Python wrapper */
10525 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
10526 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
10527  __Pyx_RefNannyDeclarations
10528  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
10529  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10530 
10531  /* function exit code */
10532  __Pyx_RefNannyFinishContext();
10533 }
10534 
10535 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
10536  int __pyx_v_i;
10537  __Pyx_TraceDeclarations
10538  __Pyx_RefNannyDeclarations
10539  int __pyx_t_1;
10540  int __pyx_t_2;
10541  int __pyx_t_3;
10542  int __pyx_t_4;
10543  int __pyx_t_5;
10544  PyThread_type_lock __pyx_t_6;
10545  PyThread_type_lock __pyx_t_7;
10546  int __pyx_lineno = 0;
10547  const char *__pyx_filename = NULL;
10548  int __pyx_clineno = 0;
10549  __Pyx_RefNannySetupContext("__dealloc__", 0);
10550  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 372, 0, __PYX_ERR(1, 372, __pyx_L1_error));
10551 
10552  /* "View.MemoryView":373
10553  *
10554  * def __dealloc__(memoryview self):
10555  * if self.obj is not None: # <<<<<<<<<<<<<<
10556  * __Pyx_ReleaseBuffer(&self.view)
10557  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10558  */
10559  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
10560  __pyx_t_2 = (__pyx_t_1 != 0);
10561  if (__pyx_t_2) {
10562 
10563  /* "View.MemoryView":374
10564  * def __dealloc__(memoryview self):
10565  * if self.obj is not None:
10566  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
10567  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10568  *
10569  */
10570  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
10571 
10572  /* "View.MemoryView":373
10573  *
10574  * def __dealloc__(memoryview self):
10575  * if self.obj is not None: # <<<<<<<<<<<<<<
10576  * __Pyx_ReleaseBuffer(&self.view)
10577  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10578  */
10579  goto __pyx_L3;
10580  }
10581 
10582  /* "View.MemoryView":375
10583  * if self.obj is not None:
10584  * __Pyx_ReleaseBuffer(&self.view)
10585  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
10586  *
10587  * (<__pyx_buffer *> &self.view).obj = NULL
10588  */
10589  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
10590  if (__pyx_t_2) {
10591 
10592  /* "View.MemoryView":377
10593  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10594  *
10595  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
10596  * Py_DECREF(Py_None)
10597  *
10598  */
10599  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
10600 
10601  /* "View.MemoryView":378
10602  *
10603  * (<__pyx_buffer *> &self.view).obj = NULL
10604  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
10605  *
10606  * cdef int i
10607  */
10608  Py_DECREF(Py_None);
10609 
10610  /* "View.MemoryView":375
10611  * if self.obj is not None:
10612  * __Pyx_ReleaseBuffer(&self.view)
10613  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
10614  *
10615  * (<__pyx_buffer *> &self.view).obj = NULL
10616  */
10617  }
10618  __pyx_L3:;
10619 
10620  /* "View.MemoryView":382
10621  * cdef int i
10622  * global __pyx_memoryview_thread_locks_used
10623  * if self.lock != NULL: # <<<<<<<<<<<<<<
10624  * for i in range(__pyx_memoryview_thread_locks_used):
10625  * if __pyx_memoryview_thread_locks[i] is self.lock:
10626  */
10627  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
10628  if (__pyx_t_2) {
10629 
10630  /* "View.MemoryView":383
10631  * global __pyx_memoryview_thread_locks_used
10632  * if self.lock != NULL:
10633  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
10634  * if __pyx_memoryview_thread_locks[i] is self.lock:
10635  * __pyx_memoryview_thread_locks_used -= 1
10636  */
10637  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
10638  __pyx_t_4 = __pyx_t_3;
10639  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
10640  __pyx_v_i = __pyx_t_5;
10641 
10642  /* "View.MemoryView":384
10643  * if self.lock != NULL:
10644  * for i in range(__pyx_memoryview_thread_locks_used):
10645  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
10646  * __pyx_memoryview_thread_locks_used -= 1
10647  * if i != __pyx_memoryview_thread_locks_used:
10648  */
10649  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
10650  if (__pyx_t_2) {
10651 
10652  /* "View.MemoryView":385
10653  * for i in range(__pyx_memoryview_thread_locks_used):
10654  * if __pyx_memoryview_thread_locks[i] is self.lock:
10655  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
10656  * if i != __pyx_memoryview_thread_locks_used:
10657  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10658  */
10659  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
10660 
10661  /* "View.MemoryView":386
10662  * if __pyx_memoryview_thread_locks[i] is self.lock:
10663  * __pyx_memoryview_thread_locks_used -= 1
10664  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
10665  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10666  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10667  */
10668  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
10669  if (__pyx_t_2) {
10670 
10671  /* "View.MemoryView":388
10672  * if i != __pyx_memoryview_thread_locks_used:
10673  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10674  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
10675  * break
10676  * else:
10677  */
10678  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10679  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
10680 
10681  /* "View.MemoryView":387
10682  * __pyx_memoryview_thread_locks_used -= 1
10683  * if i != __pyx_memoryview_thread_locks_used:
10684  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
10685  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10686  * break
10687  */
10688  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
10689  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
10690 
10691  /* "View.MemoryView":386
10692  * if __pyx_memoryview_thread_locks[i] is self.lock:
10693  * __pyx_memoryview_thread_locks_used -= 1
10694  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
10695  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10696  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10697  */
10698  }
10699 
10700  /* "View.MemoryView":389
10701  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10702  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10703  * break # <<<<<<<<<<<<<<
10704  * else:
10705  * PyThread_free_lock(self.lock)
10706  */
10707  goto __pyx_L6_break;
10708 
10709  /* "View.MemoryView":384
10710  * if self.lock != NULL:
10711  * for i in range(__pyx_memoryview_thread_locks_used):
10712  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
10713  * __pyx_memoryview_thread_locks_used -= 1
10714  * if i != __pyx_memoryview_thread_locks_used:
10715  */
10716  }
10717  }
10718  /*else*/ {
10719 
10720  /* "View.MemoryView":391
10721  * break
10722  * else:
10723  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
10724  *
10725  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
10726  */
10727  PyThread_free_lock(__pyx_v_self->lock);
10728  }
10729  __pyx_L6_break:;
10730 
10731  /* "View.MemoryView":382
10732  * cdef int i
10733  * global __pyx_memoryview_thread_locks_used
10734  * if self.lock != NULL: # <<<<<<<<<<<<<<
10735  * for i in range(__pyx_memoryview_thread_locks_used):
10736  * if __pyx_memoryview_thread_locks[i] is self.lock:
10737  */
10738  }
10739 
10740  /* "View.MemoryView":372
10741  * self.typeinfo = NULL
10742  *
10743  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
10744  * if self.obj is not None:
10745  * __Pyx_ReleaseBuffer(&self.view)
10746  */
10747 
10748  /* function exit code */
10749  goto __pyx_L0;
10750  __pyx_L1_error:;
10751  __Pyx_WriteUnraisable("View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
10752  __pyx_L0:;
10753  __Pyx_TraceReturn(Py_None, 0);
10754  __Pyx_RefNannyFinishContext();
10755 }
10756 
10757 /* "View.MemoryView":393
10758  * PyThread_free_lock(self.lock)
10759  *
10760  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
10761  * cdef Py_ssize_t dim
10762  * cdef char *itemp = <char *> self.view.buf
10763  */
10764 
10765 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10766  Py_ssize_t __pyx_v_dim;
10767  char *__pyx_v_itemp;
10768  PyObject *__pyx_v_idx = NULL;
10769  char *__pyx_r;
10770  __Pyx_TraceDeclarations
10771  __Pyx_RefNannyDeclarations
10772  Py_ssize_t __pyx_t_1;
10773  PyObject *__pyx_t_2 = NULL;
10774  Py_ssize_t __pyx_t_3;
10775  PyObject *(*__pyx_t_4)(PyObject *);
10776  PyObject *__pyx_t_5 = NULL;
10777  Py_ssize_t __pyx_t_6;
10778  char *__pyx_t_7;
10779  int __pyx_lineno = 0;
10780  const char *__pyx_filename = NULL;
10781  int __pyx_clineno = 0;
10782  __Pyx_RefNannySetupContext("get_item_pointer", 0);
10783  __Pyx_TraceCall("get_item_pointer", __pyx_f[1], 393, 0, __PYX_ERR(1, 393, __pyx_L1_error));
10784 
10785  /* "View.MemoryView":395
10786  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
10787  * cdef Py_ssize_t dim
10788  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
10789  *
10790  * for dim, idx in enumerate(index):
10791  */
10792  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
10793 
10794  /* "View.MemoryView":397
10795  * cdef char *itemp = <char *> self.view.buf
10796  *
10797  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
10798  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10799  *
10800  */
10801  __pyx_t_1 = 0;
10802  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
10803  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
10804  __pyx_t_4 = NULL;
10805  } else {
10806  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
10807  __Pyx_GOTREF(__pyx_t_2);
10808  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
10809  }
10810  for (;;) {
10811  if (likely(!__pyx_t_4)) {
10812  if (likely(PyList_CheckExact(__pyx_t_2))) {
10813  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
10814  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10815  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
10816  #else
10817  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
10818  __Pyx_GOTREF(__pyx_t_5);
10819  #endif
10820  } else {
10821  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
10822  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10823  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
10824  #else
10825  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
10826  __Pyx_GOTREF(__pyx_t_5);
10827  #endif
10828  }
10829  } else {
10830  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
10831  if (unlikely(!__pyx_t_5)) {
10832  PyObject* exc_type = PyErr_Occurred();
10833  if (exc_type) {
10834  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
10835  else __PYX_ERR(1, 397, __pyx_L1_error)
10836  }
10837  break;
10838  }
10839  __Pyx_GOTREF(__pyx_t_5);
10840  }
10841  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
10842  __pyx_t_5 = 0;
10843  __pyx_v_dim = __pyx_t_1;
10844  __pyx_t_1 = (__pyx_t_1 + 1);
10845 
10846  /* "View.MemoryView":398
10847  *
10848  * for dim, idx in enumerate(index):
10849  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
10850  *
10851  * return itemp
10852  */
10853  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
10854  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error)
10855  __pyx_v_itemp = __pyx_t_7;
10856 
10857  /* "View.MemoryView":397
10858  * cdef char *itemp = <char *> self.view.buf
10859  *
10860  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
10861  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10862  *
10863  */
10864  }
10865  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10866 
10867  /* "View.MemoryView":400
10868  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10869  *
10870  * return itemp # <<<<<<<<<<<<<<
10871  *
10872  *
10873  */
10874  __pyx_r = __pyx_v_itemp;
10875  goto __pyx_L0;
10876 
10877  /* "View.MemoryView":393
10878  * PyThread_free_lock(self.lock)
10879  *
10880  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
10881  * cdef Py_ssize_t dim
10882  * cdef char *itemp = <char *> self.view.buf
10883  */
10884 
10885  /* function exit code */
10886  __pyx_L1_error:;
10887  __Pyx_XDECREF(__pyx_t_2);
10888  __Pyx_XDECREF(__pyx_t_5);
10889  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
10890  __pyx_r = NULL;
10891  __pyx_L0:;
10892  __Pyx_XDECREF(__pyx_v_idx);
10893  __Pyx_TraceReturn(Py_None, 0);
10894  __Pyx_RefNannyFinishContext();
10895  return __pyx_r;
10896 }
10897 
10898 /* "View.MemoryView":403
10899  *
10900  *
10901  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
10902  * if index is Ellipsis:
10903  * return self
10904  */
10905 
10906 /* Python wrapper */
10907 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
10908 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
10909  PyObject *__pyx_r = 0;
10910  __Pyx_RefNannyDeclarations
10911  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
10912  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
10913 
10914  /* function exit code */
10915  __Pyx_RefNannyFinishContext();
10916  return __pyx_r;
10917 }
10918 
10919 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10920  PyObject *__pyx_v_have_slices = NULL;
10921  PyObject *__pyx_v_indices = NULL;
10922  char *__pyx_v_itemp;
10923  PyObject *__pyx_r = NULL;
10924  __Pyx_TraceDeclarations
10925  __Pyx_RefNannyDeclarations
10926  int __pyx_t_1;
10927  int __pyx_t_2;
10928  PyObject *__pyx_t_3 = NULL;
10929  PyObject *__pyx_t_4 = NULL;
10930  PyObject *__pyx_t_5 = NULL;
10931  char *__pyx_t_6;
10932  int __pyx_lineno = 0;
10933  const char *__pyx_filename = NULL;
10934  int __pyx_clineno = 0;
10935  __Pyx_RefNannySetupContext("__getitem__", 0);
10936  __Pyx_TraceCall("__getitem__", __pyx_f[1], 403, 0, __PYX_ERR(1, 403, __pyx_L1_error));
10937 
10938  /* "View.MemoryView":404
10939  *
10940  * def __getitem__(memoryview self, object index):
10941  * if index is Ellipsis: # <<<<<<<<<<<<<<
10942  * return self
10943  *
10944  */
10945  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
10946  __pyx_t_2 = (__pyx_t_1 != 0);
10947  if (__pyx_t_2) {
10948 
10949  /* "View.MemoryView":405
10950  * def __getitem__(memoryview self, object index):
10951  * if index is Ellipsis:
10952  * return self # <<<<<<<<<<<<<<
10953  *
10954  * have_slices, indices = _unellipsify(index, self.view.ndim)
10955  */
10956  __Pyx_XDECREF(__pyx_r);
10957  __Pyx_INCREF(((PyObject *)__pyx_v_self));
10958  __pyx_r = ((PyObject *)__pyx_v_self);
10959  goto __pyx_L0;
10960 
10961  /* "View.MemoryView":404
10962  *
10963  * def __getitem__(memoryview self, object index):
10964  * if index is Ellipsis: # <<<<<<<<<<<<<<
10965  * return self
10966  *
10967  */
10968  }
10969 
10970  /* "View.MemoryView":407
10971  * return self
10972  *
10973  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
10974  *
10975  * cdef char *itemp
10976  */
10977  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
10978  __Pyx_GOTREF(__pyx_t_3);
10979  if (likely(__pyx_t_3 != Py_None)) {
10980  PyObject* sequence = __pyx_t_3;
10981  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10982  if (unlikely(size != 2)) {
10983  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10984  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10985  __PYX_ERR(1, 407, __pyx_L1_error)
10986  }
10987  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10988  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
10989  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
10990  __Pyx_INCREF(__pyx_t_4);
10991  __Pyx_INCREF(__pyx_t_5);
10992  #else
10993  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
10994  __Pyx_GOTREF(__pyx_t_4);
10995  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
10996  __Pyx_GOTREF(__pyx_t_5);
10997  #endif
10998  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10999  } else {
11000  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
11001  }
11002  __pyx_v_have_slices = __pyx_t_4;
11003  __pyx_t_4 = 0;
11004  __pyx_v_indices = __pyx_t_5;
11005  __pyx_t_5 = 0;
11006 
11007  /* "View.MemoryView":410
11008  *
11009  * cdef char *itemp
11010  * if have_slices: # <<<<<<<<<<<<<<
11011  * return memview_slice(self, indices)
11012  * else:
11013  */
11014  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
11015  if (__pyx_t_2) {
11016 
11017  /* "View.MemoryView":411
11018  * cdef char *itemp
11019  * if have_slices:
11020  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
11021  * else:
11022  * itemp = self.get_item_pointer(indices)
11023  */
11024  __Pyx_XDECREF(__pyx_r);
11025  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
11026  __Pyx_GOTREF(__pyx_t_3);
11027  __pyx_r = __pyx_t_3;
11028  __pyx_t_3 = 0;
11029  goto __pyx_L0;
11030 
11031  /* "View.MemoryView":410
11032  *
11033  * cdef char *itemp
11034  * if have_slices: # <<<<<<<<<<<<<<
11035  * return memview_slice(self, indices)
11036  * else:
11037  */
11038  }
11039 
11040  /* "View.MemoryView":413
11041  * return memview_slice(self, indices)
11042  * else:
11043  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
11044  * return self.convert_item_to_object(itemp)
11045  *
11046  */
11047  /*else*/ {
11048  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error)
11049  __pyx_v_itemp = __pyx_t_6;
11050 
11051  /* "View.MemoryView":414
11052  * else:
11053  * itemp = self.get_item_pointer(indices)
11054  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
11055  *
11056  * def __setitem__(memoryview self, object index, object value):
11057  */
11058  __Pyx_XDECREF(__pyx_r);
11059  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error)
11060  __Pyx_GOTREF(__pyx_t_3);
11061  __pyx_r = __pyx_t_3;
11062  __pyx_t_3 = 0;
11063  goto __pyx_L0;
11064  }
11065 
11066  /* "View.MemoryView":403
11067  *
11068  *
11069  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11070  * if index is Ellipsis:
11071  * return self
11072  */
11073 
11074  /* function exit code */
11075  __pyx_L1_error:;
11076  __Pyx_XDECREF(__pyx_t_3);
11077  __Pyx_XDECREF(__pyx_t_4);
11078  __Pyx_XDECREF(__pyx_t_5);
11079  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11080  __pyx_r = NULL;
11081  __pyx_L0:;
11082  __Pyx_XDECREF(__pyx_v_have_slices);
11083  __Pyx_XDECREF(__pyx_v_indices);
11084  __Pyx_XGIVEREF(__pyx_r);
11085  __Pyx_TraceReturn(__pyx_r, 0);
11086  __Pyx_RefNannyFinishContext();
11087  return __pyx_r;
11088 }
11089 
11090 /* "View.MemoryView":416
11091  * return self.convert_item_to_object(itemp)
11092  *
11093  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11094  * if self.view.readonly:
11095  * raise TypeError("Cannot assign to read-only memoryview")
11096  */
11097 
11098 /* Python wrapper */
11099 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
11100 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11101  int __pyx_r;
11102  __Pyx_RefNannyDeclarations
11103  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
11104  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
11105 
11106  /* function exit code */
11107  __Pyx_RefNannyFinishContext();
11108  return __pyx_r;
11109 }
11110 
11111 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11112  PyObject *__pyx_v_have_slices = NULL;
11113  PyObject *__pyx_v_obj = NULL;
11114  int __pyx_r;
11115  __Pyx_TraceDeclarations
11116  __Pyx_RefNannyDeclarations
11117  int __pyx_t_1;
11118  PyObject *__pyx_t_2 = NULL;
11119  PyObject *__pyx_t_3 = NULL;
11120  PyObject *__pyx_t_4 = NULL;
11121  int __pyx_lineno = 0;
11122  const char *__pyx_filename = NULL;
11123  int __pyx_clineno = 0;
11124  __Pyx_RefNannySetupContext("__setitem__", 0);
11125  __Pyx_TraceCall("__setitem__", __pyx_f[1], 416, 0, __PYX_ERR(1, 416, __pyx_L1_error));
11126  __Pyx_INCREF(__pyx_v_index);
11127 
11128  /* "View.MemoryView":417
11129  *
11130  * def __setitem__(memoryview self, object index, object value):
11131  * if self.view.readonly: # <<<<<<<<<<<<<<
11132  * raise TypeError("Cannot assign to read-only memoryview")
11133  *
11134  */
11135  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
11136  if (unlikely(__pyx_t_1)) {
11137 
11138  /* "View.MemoryView":418
11139  * def __setitem__(memoryview self, object index, object value):
11140  * if self.view.readonly:
11141  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
11142  *
11143  * have_slices, index = _unellipsify(index, self.view.ndim)
11144  */
11145  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
11146  __Pyx_GOTREF(__pyx_t_2);
11147  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11148  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11149  __PYX_ERR(1, 418, __pyx_L1_error)
11150 
11151  /* "View.MemoryView":417
11152  *
11153  * def __setitem__(memoryview self, object index, object value):
11154  * if self.view.readonly: # <<<<<<<<<<<<<<
11155  * raise TypeError("Cannot assign to read-only memoryview")
11156  *
11157  */
11158  }
11159 
11160  /* "View.MemoryView":420
11161  * raise TypeError("Cannot assign to read-only memoryview")
11162  *
11163  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11164  *
11165  * if have_slices:
11166  */
11167  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
11168  __Pyx_GOTREF(__pyx_t_2);
11169  if (likely(__pyx_t_2 != Py_None)) {
11170  PyObject* sequence = __pyx_t_2;
11171  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11172  if (unlikely(size != 2)) {
11173  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11174  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11175  __PYX_ERR(1, 420, __pyx_L1_error)
11176  }
11177  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11178  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
11179  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
11180  __Pyx_INCREF(__pyx_t_3);
11181  __Pyx_INCREF(__pyx_t_4);
11182  #else
11183  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
11184  __Pyx_GOTREF(__pyx_t_3);
11185  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
11186  __Pyx_GOTREF(__pyx_t_4);
11187  #endif
11188  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11189  } else {
11190  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
11191  }
11192  __pyx_v_have_slices = __pyx_t_3;
11193  __pyx_t_3 = 0;
11194  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
11195  __pyx_t_4 = 0;
11196 
11197  /* "View.MemoryView":422
11198  * have_slices, index = _unellipsify(index, self.view.ndim)
11199  *
11200  * if have_slices: # <<<<<<<<<<<<<<
11201  * obj = self.is_slice(value)
11202  * if obj:
11203  */
11204  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
11205  if (__pyx_t_1) {
11206 
11207  /* "View.MemoryView":423
11208  *
11209  * if have_slices:
11210  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
11211  * if obj:
11212  * self.setitem_slice_assignment(self[index], obj)
11213  */
11214  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
11215  __Pyx_GOTREF(__pyx_t_2);
11216  __pyx_v_obj = __pyx_t_2;
11217  __pyx_t_2 = 0;
11218 
11219  /* "View.MemoryView":424
11220  * if have_slices:
11221  * obj = self.is_slice(value)
11222  * if obj: # <<<<<<<<<<<<<<
11223  * self.setitem_slice_assignment(self[index], obj)
11224  * else:
11225  */
11226  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
11227  if (__pyx_t_1) {
11228 
11229  /* "View.MemoryView":425
11230  * obj = self.is_slice(value)
11231  * if obj:
11232  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
11233  * else:
11234  * self.setitem_slice_assign_scalar(self[index], value)
11235  */
11236  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
11237  __Pyx_GOTREF(__pyx_t_2);
11238  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error)
11239  __Pyx_GOTREF(__pyx_t_4);
11240  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11241  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11242 
11243  /* "View.MemoryView":424
11244  * if have_slices:
11245  * obj = self.is_slice(value)
11246  * if obj: # <<<<<<<<<<<<<<
11247  * self.setitem_slice_assignment(self[index], obj)
11248  * else:
11249  */
11250  goto __pyx_L5;
11251  }
11252 
11253  /* "View.MemoryView":427
11254  * self.setitem_slice_assignment(self[index], obj)
11255  * else:
11256  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
11257  * else:
11258  * self.setitem_indexed(index, value)
11259  */
11260  /*else*/ {
11261  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
11262  __Pyx_GOTREF(__pyx_t_4);
11263  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
11264  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
11265  __Pyx_GOTREF(__pyx_t_2);
11266  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11267  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11268  }
11269  __pyx_L5:;
11270 
11271  /* "View.MemoryView":422
11272  * have_slices, index = _unellipsify(index, self.view.ndim)
11273  *
11274  * if have_slices: # <<<<<<<<<<<<<<
11275  * obj = self.is_slice(value)
11276  * if obj:
11277  */
11278  goto __pyx_L4;
11279  }
11280 
11281  /* "View.MemoryView":429
11282  * self.setitem_slice_assign_scalar(self[index], value)
11283  * else:
11284  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
11285  *
11286  * cdef is_slice(self, obj):
11287  */
11288  /*else*/ {
11289  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
11290  __Pyx_GOTREF(__pyx_t_2);
11291  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11292  }
11293  __pyx_L4:;
11294 
11295  /* "View.MemoryView":416
11296  * return self.convert_item_to_object(itemp)
11297  *
11298  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11299  * if self.view.readonly:
11300  * raise TypeError("Cannot assign to read-only memoryview")
11301  */
11302 
11303  /* function exit code */
11304  __pyx_r = 0;
11305  goto __pyx_L0;
11306  __pyx_L1_error:;
11307  __Pyx_XDECREF(__pyx_t_2);
11308  __Pyx_XDECREF(__pyx_t_3);
11309  __Pyx_XDECREF(__pyx_t_4);
11310  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11311  __pyx_r = -1;
11312  __pyx_L0:;
11313  __Pyx_XDECREF(__pyx_v_have_slices);
11314  __Pyx_XDECREF(__pyx_v_obj);
11315  __Pyx_XDECREF(__pyx_v_index);
11316  __Pyx_TraceReturn(Py_None, 0);
11317  __Pyx_RefNannyFinishContext();
11318  return __pyx_r;
11319 }
11320 
11321 /* "View.MemoryView":431
11322  * self.setitem_indexed(index, value)
11323  *
11324  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
11325  * if not isinstance(obj, memoryview):
11326  * try:
11327  */
11328 
11329 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
11330  PyObject *__pyx_r = NULL;
11331  __Pyx_TraceDeclarations
11332  __Pyx_RefNannyDeclarations
11333  int __pyx_t_1;
11334  int __pyx_t_2;
11335  PyObject *__pyx_t_3 = NULL;
11336  PyObject *__pyx_t_4 = NULL;
11337  PyObject *__pyx_t_5 = NULL;
11338  PyObject *__pyx_t_6 = NULL;
11339  PyObject *__pyx_t_7 = NULL;
11340  PyObject *__pyx_t_8 = NULL;
11341  int __pyx_t_9;
11342  int __pyx_lineno = 0;
11343  const char *__pyx_filename = NULL;
11344  int __pyx_clineno = 0;
11345  __Pyx_RefNannySetupContext("is_slice", 0);
11346  __Pyx_TraceCall("is_slice", __pyx_f[1], 431, 0, __PYX_ERR(1, 431, __pyx_L1_error));
11347  __Pyx_INCREF(__pyx_v_obj);
11348 
11349  /* "View.MemoryView":432
11350  *
11351  * cdef is_slice(self, obj):
11352  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
11353  * try:
11354  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11355  */
11356  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
11357  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
11358  if (__pyx_t_2) {
11359 
11360  /* "View.MemoryView":433
11361  * cdef is_slice(self, obj):
11362  * if not isinstance(obj, memoryview):
11363  * try: # <<<<<<<<<<<<<<
11364  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11365  * self.dtype_is_object)
11366  */
11367  {
11368  __Pyx_PyThreadState_declare
11369  __Pyx_PyThreadState_assign
11370  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
11371  __Pyx_XGOTREF(__pyx_t_3);
11372  __Pyx_XGOTREF(__pyx_t_4);
11373  __Pyx_XGOTREF(__pyx_t_5);
11374  /*try:*/ {
11375 
11376  /* "View.MemoryView":434
11377  * if not isinstance(obj, memoryview):
11378  * try:
11379  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11380  * self.dtype_is_object)
11381  * except TypeError:
11382  */
11383  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
11384  __Pyx_GOTREF(__pyx_t_6);
11385 
11386  /* "View.MemoryView":435
11387  * try:
11388  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11389  * self.dtype_is_object) # <<<<<<<<<<<<<<
11390  * except TypeError:
11391  * return None
11392  */
11393  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
11394  __Pyx_GOTREF(__pyx_t_7);
11395 
11396  /* "View.MemoryView":434
11397  * if not isinstance(obj, memoryview):
11398  * try:
11399  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11400  * self.dtype_is_object)
11401  * except TypeError:
11402  */
11403  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
11404  __Pyx_GOTREF(__pyx_t_8);
11405  __Pyx_INCREF(__pyx_v_obj);
11406  __Pyx_GIVEREF(__pyx_v_obj);
11407  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
11408  __Pyx_GIVEREF(__pyx_t_6);
11409  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
11410  __Pyx_GIVEREF(__pyx_t_7);
11411  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
11412  __pyx_t_6 = 0;
11413  __pyx_t_7 = 0;
11414  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
11415  __Pyx_GOTREF(__pyx_t_7);
11416  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11417  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
11418  __pyx_t_7 = 0;
11419 
11420  /* "View.MemoryView":433
11421  * cdef is_slice(self, obj):
11422  * if not isinstance(obj, memoryview):
11423  * try: # <<<<<<<<<<<<<<
11424  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11425  * self.dtype_is_object)
11426  */
11427  }
11428  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11429  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11430  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11431  goto __pyx_L9_try_end;
11432  __pyx_L4_error:;
11433  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11434  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11435  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11436 
11437  /* "View.MemoryView":436
11438  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11439  * self.dtype_is_object)
11440  * except TypeError: # <<<<<<<<<<<<<<
11441  * return None
11442  *
11443  */
11444  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
11445  if (__pyx_t_9) {
11446  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11447  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
11448  __Pyx_GOTREF(__pyx_t_7);
11449  __Pyx_GOTREF(__pyx_t_8);
11450  __Pyx_GOTREF(__pyx_t_6);
11451 
11452  /* "View.MemoryView":437
11453  * self.dtype_is_object)
11454  * except TypeError:
11455  * return None # <<<<<<<<<<<<<<
11456  *
11457  * return obj
11458  */
11459  __Pyx_XDECREF(__pyx_r);
11460  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11461  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11462  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11463  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11464  goto __pyx_L7_except_return;
11465  }
11466  goto __pyx_L6_except_error;
11467  __pyx_L6_except_error:;
11468 
11469  /* "View.MemoryView":433
11470  * cdef is_slice(self, obj):
11471  * if not isinstance(obj, memoryview):
11472  * try: # <<<<<<<<<<<<<<
11473  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11474  * self.dtype_is_object)
11475  */
11476  __Pyx_XGIVEREF(__pyx_t_3);
11477  __Pyx_XGIVEREF(__pyx_t_4);
11478  __Pyx_XGIVEREF(__pyx_t_5);
11479  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11480  goto __pyx_L1_error;
11481  __pyx_L7_except_return:;
11482  __Pyx_XGIVEREF(__pyx_t_3);
11483  __Pyx_XGIVEREF(__pyx_t_4);
11484  __Pyx_XGIVEREF(__pyx_t_5);
11485  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11486  goto __pyx_L0;
11487  __pyx_L9_try_end:;
11488  }
11489 
11490  /* "View.MemoryView":432
11491  *
11492  * cdef is_slice(self, obj):
11493  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
11494  * try:
11495  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11496  */
11497  }
11498 
11499  /* "View.MemoryView":439
11500  * return None
11501  *
11502  * return obj # <<<<<<<<<<<<<<
11503  *
11504  * cdef setitem_slice_assignment(self, dst, src):
11505  */
11506  __Pyx_XDECREF(__pyx_r);
11507  __Pyx_INCREF(__pyx_v_obj);
11508  __pyx_r = __pyx_v_obj;
11509  goto __pyx_L0;
11510 
11511  /* "View.MemoryView":431
11512  * self.setitem_indexed(index, value)
11513  *
11514  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
11515  * if not isinstance(obj, memoryview):
11516  * try:
11517  */
11518 
11519  /* function exit code */
11520  __pyx_L1_error:;
11521  __Pyx_XDECREF(__pyx_t_6);
11522  __Pyx_XDECREF(__pyx_t_7);
11523  __Pyx_XDECREF(__pyx_t_8);
11524  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11525  __pyx_r = 0;
11526  __pyx_L0:;
11527  __Pyx_XDECREF(__pyx_v_obj);
11528  __Pyx_XGIVEREF(__pyx_r);
11529  __Pyx_TraceReturn(__pyx_r, 0);
11530  __Pyx_RefNannyFinishContext();
11531  return __pyx_r;
11532 }
11533 
11534 /* "View.MemoryView":441
11535  * return obj
11536  *
11537  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
11538  * cdef __Pyx_memviewslice dst_slice
11539  * cdef __Pyx_memviewslice src_slice
11540  */
11541 
11542 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
11543  __Pyx_memviewslice __pyx_v_dst_slice;
11544  __Pyx_memviewslice __pyx_v_src_slice;
11545  PyObject *__pyx_r = NULL;
11546  __Pyx_TraceDeclarations
11547  __Pyx_RefNannyDeclarations
11548  __Pyx_memviewslice *__pyx_t_1;
11549  __Pyx_memviewslice *__pyx_t_2;
11550  PyObject *__pyx_t_3 = NULL;
11551  int __pyx_t_4;
11552  int __pyx_t_5;
11553  int __pyx_t_6;
11554  int __pyx_lineno = 0;
11555  const char *__pyx_filename = NULL;
11556  int __pyx_clineno = 0;
11557  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
11558  __Pyx_TraceCall("setitem_slice_assignment", __pyx_f[1], 441, 0, __PYX_ERR(1, 441, __pyx_L1_error));
11559 
11560  /* "View.MemoryView":445
11561  * cdef __Pyx_memviewslice src_slice
11562  *
11563  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
11564  * get_slice_from_memview(dst, &dst_slice)[0],
11565  * src.ndim, dst.ndim, self.dtype_is_object)
11566  */
11567  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
11568  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
11569 
11570  /* "View.MemoryView":446
11571  *
11572  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
11573  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
11574  * src.ndim, dst.ndim, self.dtype_is_object)
11575  *
11576  */
11577  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
11578  __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error)
11579 
11580  /* "View.MemoryView":447
11581  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
11582  * get_slice_from_memview(dst, &dst_slice)[0],
11583  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
11584  *
11585  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
11586  */
11587  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
11588  __Pyx_GOTREF(__pyx_t_3);
11589  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
11590  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11591  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
11592  __Pyx_GOTREF(__pyx_t_3);
11593  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
11594  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11595 
11596  /* "View.MemoryView":445
11597  * cdef __Pyx_memviewslice src_slice
11598  *
11599  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
11600  * get_slice_from_memview(dst, &dst_slice)[0],
11601  * src.ndim, dst.ndim, self.dtype_is_object)
11602  */
11603  __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 445, __pyx_L1_error)
11604 
11605  /* "View.MemoryView":441
11606  * return obj
11607  *
11608  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
11609  * cdef __Pyx_memviewslice dst_slice
11610  * cdef __Pyx_memviewslice src_slice
11611  */
11612 
11613  /* function exit code */
11614  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11615  goto __pyx_L0;
11616  __pyx_L1_error:;
11617  __Pyx_XDECREF(__pyx_t_3);
11618  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
11619  __pyx_r = 0;
11620  __pyx_L0:;
11621  __Pyx_XGIVEREF(__pyx_r);
11622  __Pyx_TraceReturn(__pyx_r, 0);
11623  __Pyx_RefNannyFinishContext();
11624  return __pyx_r;
11625 }
11626 
11627 /* "View.MemoryView":449
11628  * src.ndim, dst.ndim, self.dtype_is_object)
11629  *
11630  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
11631  * cdef int array[128]
11632  * cdef void *tmp = NULL
11633  */
11634 
11635 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
11636  int __pyx_v_array[0x80];
11637  void *__pyx_v_tmp;
11638  void *__pyx_v_item;
11639  __Pyx_memviewslice *__pyx_v_dst_slice;
11640  __Pyx_memviewslice __pyx_v_tmp_slice;
11641  PyObject *__pyx_r = NULL;
11642  __Pyx_TraceDeclarations
11643  __Pyx_RefNannyDeclarations
11644  __Pyx_memviewslice *__pyx_t_1;
11645  int __pyx_t_2;
11646  PyObject *__pyx_t_3 = NULL;
11647  int __pyx_t_4;
11648  int __pyx_t_5;
11649  char const *__pyx_t_6;
11650  PyObject *__pyx_t_7 = NULL;
11651  PyObject *__pyx_t_8 = NULL;
11652  PyObject *__pyx_t_9 = NULL;
11653  PyObject *__pyx_t_10 = NULL;
11654  PyObject *__pyx_t_11 = NULL;
11655  PyObject *__pyx_t_12 = NULL;
11656  int __pyx_lineno = 0;
11657  const char *__pyx_filename = NULL;
11658  int __pyx_clineno = 0;
11659  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
11660  __Pyx_TraceCall("setitem_slice_assign_scalar", __pyx_f[1], 449, 0, __PYX_ERR(1, 449, __pyx_L1_error));
11661 
11662  /* "View.MemoryView":451
11663  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
11664  * cdef int array[128]
11665  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
11666  * cdef void *item
11667  *
11668  */
11669  __pyx_v_tmp = NULL;
11670 
11671  /* "View.MemoryView":456
11672  * cdef __Pyx_memviewslice *dst_slice
11673  * cdef __Pyx_memviewslice tmp_slice
11674  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
11675  *
11676  * if <size_t>self.view.itemsize > sizeof(array):
11677  */
11678  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error)
11679  __pyx_v_dst_slice = __pyx_t_1;
11680 
11681  /* "View.MemoryView":458
11682  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
11683  *
11684  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
11685  * tmp = PyMem_Malloc(self.view.itemsize)
11686  * if tmp == NULL:
11687  */
11688  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
11689  if (__pyx_t_2) {
11690 
11691  /* "View.MemoryView":459
11692  *
11693  * if <size_t>self.view.itemsize > sizeof(array):
11694  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
11695  * if tmp == NULL:
11696  * raise MemoryError
11697  */
11698  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
11699 
11700  /* "View.MemoryView":460
11701  * if <size_t>self.view.itemsize > sizeof(array):
11702  * tmp = PyMem_Malloc(self.view.itemsize)
11703  * if tmp == NULL: # <<<<<<<<<<<<<<
11704  * raise MemoryError
11705  * item = tmp
11706  */
11707  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
11708  if (unlikely(__pyx_t_2)) {
11709 
11710  /* "View.MemoryView":461
11711  * tmp = PyMem_Malloc(self.view.itemsize)
11712  * if tmp == NULL:
11713  * raise MemoryError # <<<<<<<<<<<<<<
11714  * item = tmp
11715  * else:
11716  */
11717  PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
11718 
11719  /* "View.MemoryView":460
11720  * if <size_t>self.view.itemsize > sizeof(array):
11721  * tmp = PyMem_Malloc(self.view.itemsize)
11722  * if tmp == NULL: # <<<<<<<<<<<<<<
11723  * raise MemoryError
11724  * item = tmp
11725  */
11726  }
11727 
11728  /* "View.MemoryView":462
11729  * if tmp == NULL:
11730  * raise MemoryError
11731  * item = tmp # <<<<<<<<<<<<<<
11732  * else:
11733  * item = <void *> array
11734  */
11735  __pyx_v_item = __pyx_v_tmp;
11736 
11737  /* "View.MemoryView":458
11738  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
11739  *
11740  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
11741  * tmp = PyMem_Malloc(self.view.itemsize)
11742  * if tmp == NULL:
11743  */
11744  goto __pyx_L3;
11745  }
11746 
11747  /* "View.MemoryView":464
11748  * item = tmp
11749  * else:
11750  * item = <void *> array # <<<<<<<<<<<<<<
11751  *
11752  * try:
11753  */
11754  /*else*/ {
11755  __pyx_v_item = ((void *)__pyx_v_array);
11756  }
11757  __pyx_L3:;
11758 
11759  /* "View.MemoryView":466
11760  * item = <void *> array
11761  *
11762  * try: # <<<<<<<<<<<<<<
11763  * if self.dtype_is_object:
11764  * (<PyObject **> item)[0] = <PyObject *> value
11765  */
11766  /*try:*/ {
11767 
11768  /* "View.MemoryView":467
11769  *
11770  * try:
11771  * if self.dtype_is_object: # <<<<<<<<<<<<<<
11772  * (<PyObject **> item)[0] = <PyObject *> value
11773  * else:
11774  */
11775  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
11776  if (__pyx_t_2) {
11777 
11778  /* "View.MemoryView":468
11779  * try:
11780  * if self.dtype_is_object:
11781  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
11782  * else:
11783  * self.assign_item_from_object(<char *> item, value)
11784  */
11785  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
11786 
11787  /* "View.MemoryView":467
11788  *
11789  * try:
11790  * if self.dtype_is_object: # <<<<<<<<<<<<<<
11791  * (<PyObject **> item)[0] = <PyObject *> value
11792  * else:
11793  */
11794  goto __pyx_L8;
11795  }
11796 
11797  /* "View.MemoryView":470
11798  * (<PyObject **> item)[0] = <PyObject *> value
11799  * else:
11800  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
11801  *
11802  *
11803  */
11804  /*else*/ {
11805  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error)
11806  __Pyx_GOTREF(__pyx_t_3);
11807  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11808  }
11809  __pyx_L8:;
11810 
11811  /* "View.MemoryView":474
11812  *
11813  *
11814  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
11815  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11816  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11817  */
11818  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
11819  if (__pyx_t_2) {
11820 
11821  /* "View.MemoryView":475
11822  *
11823  * if self.view.suboffsets != NULL:
11824  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
11825  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11826  * item, self.dtype_is_object)
11827  */
11828  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
11829  __Pyx_GOTREF(__pyx_t_3);
11830  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11831 
11832  /* "View.MemoryView":474
11833  *
11834  *
11835  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
11836  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11837  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11838  */
11839  }
11840 
11841  /* "View.MemoryView":476
11842  * if self.view.suboffsets != NULL:
11843  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11844  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
11845  * item, self.dtype_is_object)
11846  * finally:
11847  */
11848  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
11849  }
11850 
11851  /* "View.MemoryView":479
11852  * item, self.dtype_is_object)
11853  * finally:
11854  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
11855  *
11856  * cdef setitem_indexed(self, index, value):
11857  */
11858  /*finally:*/ {
11859  /*normal exit:*/{
11860  PyMem_Free(__pyx_v_tmp);
11861  goto __pyx_L7;
11862  }
11863  __pyx_L6_error:;
11864  /*exception exit:*/{
11865  __Pyx_PyThreadState_declare
11866  __Pyx_PyThreadState_assign
11867  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
11868  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11869  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
11870  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
11871  __Pyx_XGOTREF(__pyx_t_7);
11872  __Pyx_XGOTREF(__pyx_t_8);
11873  __Pyx_XGOTREF(__pyx_t_9);
11874  __Pyx_XGOTREF(__pyx_t_10);
11875  __Pyx_XGOTREF(__pyx_t_11);
11876  __Pyx_XGOTREF(__pyx_t_12);
11877  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
11878  {
11879  PyMem_Free(__pyx_v_tmp);
11880  }
11881  if (PY_MAJOR_VERSION >= 3) {
11882  __Pyx_XGIVEREF(__pyx_t_10);
11883  __Pyx_XGIVEREF(__pyx_t_11);
11884  __Pyx_XGIVEREF(__pyx_t_12);
11885  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
11886  }
11887  __Pyx_XGIVEREF(__pyx_t_7);
11888  __Pyx_XGIVEREF(__pyx_t_8);
11889  __Pyx_XGIVEREF(__pyx_t_9);
11890  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
11891  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
11892  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
11893  goto __pyx_L1_error;
11894  }
11895  __pyx_L7:;
11896  }
11897 
11898  /* "View.MemoryView":449
11899  * src.ndim, dst.ndim, self.dtype_is_object)
11900  *
11901  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
11902  * cdef int array[128]
11903  * cdef void *tmp = NULL
11904  */
11905 
11906  /* function exit code */
11907  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11908  goto __pyx_L0;
11909  __pyx_L1_error:;
11910  __Pyx_XDECREF(__pyx_t_3);
11911  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11912  __pyx_r = 0;
11913  __pyx_L0:;
11914  __Pyx_XGIVEREF(__pyx_r);
11915  __Pyx_TraceReturn(__pyx_r, 0);
11916  __Pyx_RefNannyFinishContext();
11917  return __pyx_r;
11918 }
11919 
11920 /* "View.MemoryView":481
11921  * PyMem_Free(tmp)
11922  *
11923  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
11924  * cdef char *itemp = self.get_item_pointer(index)
11925  * self.assign_item_from_object(itemp, value)
11926  */
11927 
11928 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11929  char *__pyx_v_itemp;
11930  PyObject *__pyx_r = NULL;
11931  __Pyx_TraceDeclarations
11932  __Pyx_RefNannyDeclarations
11933  char *__pyx_t_1;
11934  PyObject *__pyx_t_2 = NULL;
11935  int __pyx_lineno = 0;
11936  const char *__pyx_filename = NULL;
11937  int __pyx_clineno = 0;
11938  __Pyx_RefNannySetupContext("setitem_indexed", 0);
11939  __Pyx_TraceCall("setitem_indexed", __pyx_f[1], 481, 0, __PYX_ERR(1, 481, __pyx_L1_error));
11940 
11941  /* "View.MemoryView":482
11942  *
11943  * cdef setitem_indexed(self, index, value):
11944  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
11945  * self.assign_item_from_object(itemp, value)
11946  *
11947  */
11948  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error)
11949  __pyx_v_itemp = __pyx_t_1;
11950 
11951  /* "View.MemoryView":483
11952  * cdef setitem_indexed(self, index, value):
11953  * cdef char *itemp = self.get_item_pointer(index)
11954  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
11955  *
11956  * cdef convert_item_to_object(self, char *itemp):
11957  */
11958  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error)
11959  __Pyx_GOTREF(__pyx_t_2);
11960  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11961 
11962  /* "View.MemoryView":481
11963  * PyMem_Free(tmp)
11964  *
11965  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
11966  * cdef char *itemp = self.get_item_pointer(index)
11967  * self.assign_item_from_object(itemp, value)
11968  */
11969 
11970  /* function exit code */
11971  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11972  goto __pyx_L0;
11973  __pyx_L1_error:;
11974  __Pyx_XDECREF(__pyx_t_2);
11975  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
11976  __pyx_r = 0;
11977  __pyx_L0:;
11978  __Pyx_XGIVEREF(__pyx_r);
11979  __Pyx_TraceReturn(__pyx_r, 0);
11980  __Pyx_RefNannyFinishContext();
11981  return __pyx_r;
11982 }
11983 
11984 /* "View.MemoryView":485
11985  * self.assign_item_from_object(itemp, value)
11986  *
11987  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
11988  * """Only used if instantiated manually by the user, or if Cython doesn't
11989  * know how to convert the type"""
11990  */
11991 
11992 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
11993  PyObject *__pyx_v_struct = NULL;
11994  PyObject *__pyx_v_bytesitem = 0;
11995  PyObject *__pyx_v_result = NULL;
11996  PyObject *__pyx_r = NULL;
11997  __Pyx_TraceDeclarations
11998  __Pyx_RefNannyDeclarations
11999  PyObject *__pyx_t_1 = NULL;
12000  PyObject *__pyx_t_2 = NULL;
12001  PyObject *__pyx_t_3 = NULL;
12002  PyObject *__pyx_t_4 = NULL;
12003  PyObject *__pyx_t_5 = NULL;
12004  PyObject *__pyx_t_6 = NULL;
12005  PyObject *__pyx_t_7 = NULL;
12006  int __pyx_t_8;
12007  PyObject *__pyx_t_9 = NULL;
12008  size_t __pyx_t_10;
12009  int __pyx_t_11;
12010  int __pyx_lineno = 0;
12011  const char *__pyx_filename = NULL;
12012  int __pyx_clineno = 0;
12013  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
12014  __Pyx_TraceCall("convert_item_to_object", __pyx_f[1], 485, 0, __PYX_ERR(1, 485, __pyx_L1_error));
12015 
12016  /* "View.MemoryView":488
12017  * """Only used if instantiated manually by the user, or if Cython doesn't
12018  * know how to convert the type"""
12019  * import struct # <<<<<<<<<<<<<<
12020  * cdef bytes bytesitem
12021  *
12022  */
12023  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
12024  __Pyx_GOTREF(__pyx_t_1);
12025  __pyx_v_struct = __pyx_t_1;
12026  __pyx_t_1 = 0;
12027 
12028  /* "View.MemoryView":491
12029  * cdef bytes bytesitem
12030  *
12031  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
12032  * try:
12033  * result = struct.unpack(self.view.format, bytesitem)
12034  */
12035  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
12036  __Pyx_GOTREF(__pyx_t_1);
12037  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
12038  __pyx_t_1 = 0;
12039 
12040  /* "View.MemoryView":492
12041  *
12042  * bytesitem = itemp[:self.view.itemsize]
12043  * try: # <<<<<<<<<<<<<<
12044  * result = struct.unpack(self.view.format, bytesitem)
12045  * except struct.error:
12046  */
12047  {
12048  __Pyx_PyThreadState_declare
12049  __Pyx_PyThreadState_assign
12050  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
12051  __Pyx_XGOTREF(__pyx_t_2);
12052  __Pyx_XGOTREF(__pyx_t_3);
12053  __Pyx_XGOTREF(__pyx_t_4);
12054  /*try:*/ {
12055 
12056  /* "View.MemoryView":493
12057  * bytesitem = itemp[:self.view.itemsize]
12058  * try:
12059  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
12060  * except struct.error:
12061  * raise ValueError("Unable to convert item to object")
12062  */
12063  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
12064  __Pyx_GOTREF(__pyx_t_5);
12065  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
12066  __Pyx_GOTREF(__pyx_t_6);
12067  __pyx_t_7 = NULL;
12068  __pyx_t_8 = 0;
12069  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12070  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
12071  if (likely(__pyx_t_7)) {
12072  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
12073  __Pyx_INCREF(__pyx_t_7);
12074  __Pyx_INCREF(function);
12075  __Pyx_DECREF_SET(__pyx_t_5, function);
12076  __pyx_t_8 = 1;
12077  }
12078  }
12079  #if CYTHON_FAST_PYCALL
12080  if (PyFunction_Check(__pyx_t_5)) {
12081  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12082  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12083  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12084  __Pyx_GOTREF(__pyx_t_1);
12085  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12086  } else
12087  #endif
12088  #if CYTHON_FAST_PYCCALL
12089  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
12090  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12091  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12092  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12093  __Pyx_GOTREF(__pyx_t_1);
12094  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12095  } else
12096  #endif
12097  {
12098  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
12099  __Pyx_GOTREF(__pyx_t_9);
12100  if (__pyx_t_7) {
12101  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
12102  }
12103  __Pyx_GIVEREF(__pyx_t_6);
12104  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
12105  __Pyx_INCREF(__pyx_v_bytesitem);
12106  __Pyx_GIVEREF(__pyx_v_bytesitem);
12107  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
12108  __pyx_t_6 = 0;
12109  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12110  __Pyx_GOTREF(__pyx_t_1);
12111  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12112  }
12113  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12114  __pyx_v_result = __pyx_t_1;
12115  __pyx_t_1 = 0;
12116 
12117  /* "View.MemoryView":492
12118  *
12119  * bytesitem = itemp[:self.view.itemsize]
12120  * try: # <<<<<<<<<<<<<<
12121  * result = struct.unpack(self.view.format, bytesitem)
12122  * except struct.error:
12123  */
12124  }
12125 
12126  /* "View.MemoryView":497
12127  * raise ValueError("Unable to convert item to object")
12128  * else:
12129  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12130  * return result[0]
12131  * return result
12132  */
12133  /*else:*/ {
12134  __pyx_t_10 = strlen(__pyx_v_self->view.format);
12135  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
12136  if (__pyx_t_11) {
12137 
12138  /* "View.MemoryView":498
12139  * else:
12140  * if len(self.view.format) == 1:
12141  * return result[0] # <<<<<<<<<<<<<<
12142  * return result
12143  *
12144  */
12145  __Pyx_XDECREF(__pyx_r);
12146  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
12147  __Pyx_GOTREF(__pyx_t_1);
12148  __pyx_r = __pyx_t_1;
12149  __pyx_t_1 = 0;
12150  goto __pyx_L6_except_return;
12151 
12152  /* "View.MemoryView":497
12153  * raise ValueError("Unable to convert item to object")
12154  * else:
12155  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12156  * return result[0]
12157  * return result
12158  */
12159  }
12160 
12161  /* "View.MemoryView":499
12162  * if len(self.view.format) == 1:
12163  * return result[0]
12164  * return result # <<<<<<<<<<<<<<
12165  *
12166  * cdef assign_item_from_object(self, char *itemp, object value):
12167  */
12168  __Pyx_XDECREF(__pyx_r);
12169  __Pyx_INCREF(__pyx_v_result);
12170  __pyx_r = __pyx_v_result;
12171  goto __pyx_L6_except_return;
12172  }
12173  __pyx_L3_error:;
12174  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12175  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12176  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12177  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12178  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12179 
12180  /* "View.MemoryView":494
12181  * try:
12182  * result = struct.unpack(self.view.format, bytesitem)
12183  * except struct.error: # <<<<<<<<<<<<<<
12184  * raise ValueError("Unable to convert item to object")
12185  * else:
12186  */
12187  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
12188  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
12189  __Pyx_GOTREF(__pyx_t_6);
12190  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
12191  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12192  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
12193  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
12194  if (__pyx_t_8) {
12195  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12196  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
12197  __Pyx_GOTREF(__pyx_t_9);
12198  __Pyx_GOTREF(__pyx_t_5);
12199  __Pyx_GOTREF(__pyx_t_1);
12200 
12201  /* "View.MemoryView":495
12202  * result = struct.unpack(self.view.format, bytesitem)
12203  * except struct.error:
12204  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
12205  * else:
12206  * if len(self.view.format) == 1:
12207  */
12208  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
12209  __Pyx_GOTREF(__pyx_t_6);
12210  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
12211  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12212  __PYX_ERR(1, 495, __pyx_L5_except_error)
12213  }
12214  goto __pyx_L5_except_error;
12215  __pyx_L5_except_error:;
12216 
12217  /* "View.MemoryView":492
12218  *
12219  * bytesitem = itemp[:self.view.itemsize]
12220  * try: # <<<<<<<<<<<<<<
12221  * result = struct.unpack(self.view.format, bytesitem)
12222  * except struct.error:
12223  */
12224  __Pyx_XGIVEREF(__pyx_t_2);
12225  __Pyx_XGIVEREF(__pyx_t_3);
12226  __Pyx_XGIVEREF(__pyx_t_4);
12227  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12228  goto __pyx_L1_error;
12229  __pyx_L6_except_return:;
12230  __Pyx_XGIVEREF(__pyx_t_2);
12231  __Pyx_XGIVEREF(__pyx_t_3);
12232  __Pyx_XGIVEREF(__pyx_t_4);
12233  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12234  goto __pyx_L0;
12235  }
12236 
12237  /* "View.MemoryView":485
12238  * self.assign_item_from_object(itemp, value)
12239  *
12240  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
12241  * """Only used if instantiated manually by the user, or if Cython doesn't
12242  * know how to convert the type"""
12243  */
12244 
12245  /* function exit code */
12246  __pyx_L1_error:;
12247  __Pyx_XDECREF(__pyx_t_1);
12248  __Pyx_XDECREF(__pyx_t_5);
12249  __Pyx_XDECREF(__pyx_t_6);
12250  __Pyx_XDECREF(__pyx_t_7);
12251  __Pyx_XDECREF(__pyx_t_9);
12252  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12253  __pyx_r = 0;
12254  __pyx_L0:;
12255  __Pyx_XDECREF(__pyx_v_struct);
12256  __Pyx_XDECREF(__pyx_v_bytesitem);
12257  __Pyx_XDECREF(__pyx_v_result);
12258  __Pyx_XGIVEREF(__pyx_r);
12259  __Pyx_TraceReturn(__pyx_r, 0);
12260  __Pyx_RefNannyFinishContext();
12261  return __pyx_r;
12262 }
12263 
12264 /* "View.MemoryView":501
12265  * return result
12266  *
12267  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12268  * """Only used if instantiated manually by the user, or if Cython doesn't
12269  * know how to convert the type"""
12270  */
12271 
12272 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
12273  PyObject *__pyx_v_struct = NULL;
12274  char __pyx_v_c;
12275  PyObject *__pyx_v_bytesvalue = 0;
12276  Py_ssize_t __pyx_v_i;
12277  PyObject *__pyx_r = NULL;
12278  __Pyx_TraceDeclarations
12279  __Pyx_RefNannyDeclarations
12280  PyObject *__pyx_t_1 = NULL;
12281  int __pyx_t_2;
12282  int __pyx_t_3;
12283  PyObject *__pyx_t_4 = NULL;
12284  PyObject *__pyx_t_5 = NULL;
12285  PyObject *__pyx_t_6 = NULL;
12286  int __pyx_t_7;
12287  PyObject *__pyx_t_8 = NULL;
12288  Py_ssize_t __pyx_t_9;
12289  PyObject *__pyx_t_10 = NULL;
12290  char *__pyx_t_11;
12291  char *__pyx_t_12;
12292  char *__pyx_t_13;
12293  char *__pyx_t_14;
12294  int __pyx_lineno = 0;
12295  const char *__pyx_filename = NULL;
12296  int __pyx_clineno = 0;
12297  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
12298  __Pyx_TraceCall("assign_item_from_object", __pyx_f[1], 501, 0, __PYX_ERR(1, 501, __pyx_L1_error));
12299 
12300  /* "View.MemoryView":504
12301  * """Only used if instantiated manually by the user, or if Cython doesn't
12302  * know how to convert the type"""
12303  * import struct # <<<<<<<<<<<<<<
12304  * cdef char c
12305  * cdef bytes bytesvalue
12306  */
12307  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
12308  __Pyx_GOTREF(__pyx_t_1);
12309  __pyx_v_struct = __pyx_t_1;
12310  __pyx_t_1 = 0;
12311 
12312  /* "View.MemoryView":509
12313  * cdef Py_ssize_t i
12314  *
12315  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12316  * bytesvalue = struct.pack(self.view.format, *value)
12317  * else:
12318  */
12319  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
12320  __pyx_t_3 = (__pyx_t_2 != 0);
12321  if (__pyx_t_3) {
12322 
12323  /* "View.MemoryView":510
12324  *
12325  * if isinstance(value, tuple):
12326  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
12327  * else:
12328  * bytesvalue = struct.pack(self.view.format, value)
12329  */
12330  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
12331  __Pyx_GOTREF(__pyx_t_1);
12332  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12333  __Pyx_GOTREF(__pyx_t_4);
12334  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
12335  __Pyx_GOTREF(__pyx_t_5);
12336  __Pyx_GIVEREF(__pyx_t_4);
12337  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12338  __pyx_t_4 = 0;
12339  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12340  __Pyx_GOTREF(__pyx_t_4);
12341  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
12342  __Pyx_GOTREF(__pyx_t_6);
12343  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12344  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12345  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12346  __Pyx_GOTREF(__pyx_t_4);
12347  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12348  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12349  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error)
12350  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12351  __pyx_t_4 = 0;
12352 
12353  /* "View.MemoryView":509
12354  * cdef Py_ssize_t i
12355  *
12356  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12357  * bytesvalue = struct.pack(self.view.format, *value)
12358  * else:
12359  */
12360  goto __pyx_L3;
12361  }
12362 
12363  /* "View.MemoryView":512
12364  * bytesvalue = struct.pack(self.view.format, *value)
12365  * else:
12366  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
12367  *
12368  * for i, c in enumerate(bytesvalue):
12369  */
12370  /*else*/ {
12371  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
12372  __Pyx_GOTREF(__pyx_t_6);
12373  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
12374  __Pyx_GOTREF(__pyx_t_1);
12375  __pyx_t_5 = NULL;
12376  __pyx_t_7 = 0;
12377  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
12378  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12379  if (likely(__pyx_t_5)) {
12380  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
12381  __Pyx_INCREF(__pyx_t_5);
12382  __Pyx_INCREF(function);
12383  __Pyx_DECREF_SET(__pyx_t_6, function);
12384  __pyx_t_7 = 1;
12385  }
12386  }
12387  #if CYTHON_FAST_PYCALL
12388  if (PyFunction_Check(__pyx_t_6)) {
12389  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12390  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12391  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12392  __Pyx_GOTREF(__pyx_t_4);
12393  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12394  } else
12395  #endif
12396  #if CYTHON_FAST_PYCCALL
12397  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12398  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12399  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12400  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12401  __Pyx_GOTREF(__pyx_t_4);
12402  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12403  } else
12404  #endif
12405  {
12406  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
12407  __Pyx_GOTREF(__pyx_t_8);
12408  if (__pyx_t_5) {
12409  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12410  }
12411  __Pyx_GIVEREF(__pyx_t_1);
12412  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
12413  __Pyx_INCREF(__pyx_v_value);
12414  __Pyx_GIVEREF(__pyx_v_value);
12415  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
12416  __pyx_t_1 = 0;
12417  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12418  __Pyx_GOTREF(__pyx_t_4);
12419  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12420  }
12421  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12422  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
12423  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12424  __pyx_t_4 = 0;
12425  }
12426  __pyx_L3:;
12427 
12428  /* "View.MemoryView":514
12429  * bytesvalue = struct.pack(self.view.format, value)
12430  *
12431  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12432  * itemp[i] = c
12433  *
12434  */
12435  __pyx_t_9 = 0;
12436  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
12437  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
12438  __PYX_ERR(1, 514, __pyx_L1_error)
12439  }
12440  __Pyx_INCREF(__pyx_v_bytesvalue);
12441  __pyx_t_10 = __pyx_v_bytesvalue;
12442  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
12443  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
12444  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
12445  __pyx_t_11 = __pyx_t_14;
12446  __pyx_v_c = (__pyx_t_11[0]);
12447 
12448  /* "View.MemoryView":515
12449  *
12450  * for i, c in enumerate(bytesvalue):
12451  * itemp[i] = c # <<<<<<<<<<<<<<
12452  *
12453  * @cname('getbuffer')
12454  */
12455  __pyx_v_i = __pyx_t_9;
12456 
12457  /* "View.MemoryView":514
12458  * bytesvalue = struct.pack(self.view.format, value)
12459  *
12460  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12461  * itemp[i] = c
12462  *
12463  */
12464  __pyx_t_9 = (__pyx_t_9 + 1);
12465 
12466  /* "View.MemoryView":515
12467  *
12468  * for i, c in enumerate(bytesvalue):
12469  * itemp[i] = c # <<<<<<<<<<<<<<
12470  *
12471  * @cname('getbuffer')
12472  */
12473  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
12474  }
12475  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12476 
12477  /* "View.MemoryView":501
12478  * return result
12479  *
12480  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12481  * """Only used if instantiated manually by the user, or if Cython doesn't
12482  * know how to convert the type"""
12483  */
12484 
12485  /* function exit code */
12486  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12487  goto __pyx_L0;
12488  __pyx_L1_error:;
12489  __Pyx_XDECREF(__pyx_t_1);
12490  __Pyx_XDECREF(__pyx_t_4);
12491  __Pyx_XDECREF(__pyx_t_5);
12492  __Pyx_XDECREF(__pyx_t_6);
12493  __Pyx_XDECREF(__pyx_t_8);
12494  __Pyx_XDECREF(__pyx_t_10);
12495  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12496  __pyx_r = 0;
12497  __pyx_L0:;
12498  __Pyx_XDECREF(__pyx_v_struct);
12499  __Pyx_XDECREF(__pyx_v_bytesvalue);
12500  __Pyx_XGIVEREF(__pyx_r);
12501  __Pyx_TraceReturn(__pyx_r, 0);
12502  __Pyx_RefNannyFinishContext();
12503  return __pyx_r;
12504 }
12505 
12506 /* "View.MemoryView":518
12507  *
12508  * @cname('getbuffer')
12509  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
12510  * if flags & PyBUF_WRITABLE and self.view.readonly:
12511  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12512  */
12513 
12514 /* Python wrapper */
12515 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
12516 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12517  int __pyx_r;
12518  __Pyx_RefNannyDeclarations
12519  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
12520  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
12521 
12522  /* function exit code */
12523  __Pyx_RefNannyFinishContext();
12524  return __pyx_r;
12525 }
12526 
12527 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12528  int __pyx_r;
12529  __Pyx_TraceDeclarations
12530  __Pyx_RefNannyDeclarations
12531  int __pyx_t_1;
12532  int __pyx_t_2;
12533  PyObject *__pyx_t_3 = NULL;
12534  Py_ssize_t *__pyx_t_4;
12535  char *__pyx_t_5;
12536  void *__pyx_t_6;
12537  int __pyx_t_7;
12538  Py_ssize_t __pyx_t_8;
12539  int __pyx_lineno = 0;
12540  const char *__pyx_filename = NULL;
12541  int __pyx_clineno = 0;
12542  if (__pyx_v_info == NULL) {
12543  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
12544  return -1;
12545  }
12546  __Pyx_RefNannySetupContext("__getbuffer__", 0);
12547  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12548  __Pyx_GIVEREF(__pyx_v_info->obj);
12549  __Pyx_TraceCall("__getbuffer__", __pyx_f[1], 518, 0, __PYX_ERR(1, 518, __pyx_L1_error));
12550 
12551  /* "View.MemoryView":519
12552  * @cname('getbuffer')
12553  * def __getbuffer__(self, Py_buffer *info, int flags):
12554  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
12555  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12556  *
12557  */
12558  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
12559  if (__pyx_t_2) {
12560  } else {
12561  __pyx_t_1 = __pyx_t_2;
12562  goto __pyx_L4_bool_binop_done;
12563  }
12564  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
12565  __pyx_t_1 = __pyx_t_2;
12566  __pyx_L4_bool_binop_done:;
12567  if (unlikely(__pyx_t_1)) {
12568 
12569  /* "View.MemoryView":520
12570  * def __getbuffer__(self, Py_buffer *info, int flags):
12571  * if flags & PyBUF_WRITABLE and self.view.readonly:
12572  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
12573  *
12574  * if flags & PyBUF_ND:
12575  */
12576  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
12577  __Pyx_GOTREF(__pyx_t_3);
12578  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12579  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12580  __PYX_ERR(1, 520, __pyx_L1_error)
12581 
12582  /* "View.MemoryView":519
12583  * @cname('getbuffer')
12584  * def __getbuffer__(self, Py_buffer *info, int flags):
12585  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
12586  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12587  *
12588  */
12589  }
12590 
12591  /* "View.MemoryView":522
12592  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12593  *
12594  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
12595  * info.shape = self.view.shape
12596  * else:
12597  */
12598  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
12599  if (__pyx_t_1) {
12600 
12601  /* "View.MemoryView":523
12602  *
12603  * if flags & PyBUF_ND:
12604  * info.shape = self.view.shape # <<<<<<<<<<<<<<
12605  * else:
12606  * info.shape = NULL
12607  */
12608  __pyx_t_4 = __pyx_v_self->view.shape;
12609  __pyx_v_info->shape = __pyx_t_4;
12610 
12611  /* "View.MemoryView":522
12612  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12613  *
12614  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
12615  * info.shape = self.view.shape
12616  * else:
12617  */
12618  goto __pyx_L6;
12619  }
12620 
12621  /* "View.MemoryView":525
12622  * info.shape = self.view.shape
12623  * else:
12624  * info.shape = NULL # <<<<<<<<<<<<<<
12625  *
12626  * if flags & PyBUF_STRIDES:
12627  */
12628  /*else*/ {
12629  __pyx_v_info->shape = NULL;
12630  }
12631  __pyx_L6:;
12632 
12633  /* "View.MemoryView":527
12634  * info.shape = NULL
12635  *
12636  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
12637  * info.strides = self.view.strides
12638  * else:
12639  */
12640  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
12641  if (__pyx_t_1) {
12642 
12643  /* "View.MemoryView":528
12644  *
12645  * if flags & PyBUF_STRIDES:
12646  * info.strides = self.view.strides # <<<<<<<<<<<<<<
12647  * else:
12648  * info.strides = NULL
12649  */
12650  __pyx_t_4 = __pyx_v_self->view.strides;
12651  __pyx_v_info->strides = __pyx_t_4;
12652 
12653  /* "View.MemoryView":527
12654  * info.shape = NULL
12655  *
12656  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
12657  * info.strides = self.view.strides
12658  * else:
12659  */
12660  goto __pyx_L7;
12661  }
12662 
12663  /* "View.MemoryView":530
12664  * info.strides = self.view.strides
12665  * else:
12666  * info.strides = NULL # <<<<<<<<<<<<<<
12667  *
12668  * if flags & PyBUF_INDIRECT:
12669  */
12670  /*else*/ {
12671  __pyx_v_info->strides = NULL;
12672  }
12673  __pyx_L7:;
12674 
12675  /* "View.MemoryView":532
12676  * info.strides = NULL
12677  *
12678  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
12679  * info.suboffsets = self.view.suboffsets
12680  * else:
12681  */
12682  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
12683  if (__pyx_t_1) {
12684 
12685  /* "View.MemoryView":533
12686  *
12687  * if flags & PyBUF_INDIRECT:
12688  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
12689  * else:
12690  * info.suboffsets = NULL
12691  */
12692  __pyx_t_4 = __pyx_v_self->view.suboffsets;
12693  __pyx_v_info->suboffsets = __pyx_t_4;
12694 
12695  /* "View.MemoryView":532
12696  * info.strides = NULL
12697  *
12698  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
12699  * info.suboffsets = self.view.suboffsets
12700  * else:
12701  */
12702  goto __pyx_L8;
12703  }
12704 
12705  /* "View.MemoryView":535
12706  * info.suboffsets = self.view.suboffsets
12707  * else:
12708  * info.suboffsets = NULL # <<<<<<<<<<<<<<
12709  *
12710  * if flags & PyBUF_FORMAT:
12711  */
12712  /*else*/ {
12713  __pyx_v_info->suboffsets = NULL;
12714  }
12715  __pyx_L8:;
12716 
12717  /* "View.MemoryView":537
12718  * info.suboffsets = NULL
12719  *
12720  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12721  * info.format = self.view.format
12722  * else:
12723  */
12724  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12725  if (__pyx_t_1) {
12726 
12727  /* "View.MemoryView":538
12728  *
12729  * if flags & PyBUF_FORMAT:
12730  * info.format = self.view.format # <<<<<<<<<<<<<<
12731  * else:
12732  * info.format = NULL
12733  */
12734  __pyx_t_5 = __pyx_v_self->view.format;
12735  __pyx_v_info->format = __pyx_t_5;
12736 
12737  /* "View.MemoryView":537
12738  * info.suboffsets = NULL
12739  *
12740  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12741  * info.format = self.view.format
12742  * else:
12743  */
12744  goto __pyx_L9;
12745  }
12746 
12747  /* "View.MemoryView":540
12748  * info.format = self.view.format
12749  * else:
12750  * info.format = NULL # <<<<<<<<<<<<<<
12751  *
12752  * info.buf = self.view.buf
12753  */
12754  /*else*/ {
12755  __pyx_v_info->format = NULL;
12756  }
12757  __pyx_L9:;
12758 
12759  /* "View.MemoryView":542
12760  * info.format = NULL
12761  *
12762  * info.buf = self.view.buf # <<<<<<<<<<<<<<
12763  * info.ndim = self.view.ndim
12764  * info.itemsize = self.view.itemsize
12765  */
12766  __pyx_t_6 = __pyx_v_self->view.buf;
12767  __pyx_v_info->buf = __pyx_t_6;
12768 
12769  /* "View.MemoryView":543
12770  *
12771  * info.buf = self.view.buf
12772  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
12773  * info.itemsize = self.view.itemsize
12774  * info.len = self.view.len
12775  */
12776  __pyx_t_7 = __pyx_v_self->view.ndim;
12777  __pyx_v_info->ndim = __pyx_t_7;
12778 
12779  /* "View.MemoryView":544
12780  * info.buf = self.view.buf
12781  * info.ndim = self.view.ndim
12782  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
12783  * info.len = self.view.len
12784  * info.readonly = self.view.readonly
12785  */
12786  __pyx_t_8 = __pyx_v_self->view.itemsize;
12787  __pyx_v_info->itemsize = __pyx_t_8;
12788 
12789  /* "View.MemoryView":545
12790  * info.ndim = self.view.ndim
12791  * info.itemsize = self.view.itemsize
12792  * info.len = self.view.len # <<<<<<<<<<<<<<
12793  * info.readonly = self.view.readonly
12794  * info.obj = self
12795  */
12796  __pyx_t_8 = __pyx_v_self->view.len;
12797  __pyx_v_info->len = __pyx_t_8;
12798 
12799  /* "View.MemoryView":546
12800  * info.itemsize = self.view.itemsize
12801  * info.len = self.view.len
12802  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
12803  * info.obj = self
12804  *
12805  */
12806  __pyx_t_1 = __pyx_v_self->view.readonly;
12807  __pyx_v_info->readonly = __pyx_t_1;
12808 
12809  /* "View.MemoryView":547
12810  * info.len = self.view.len
12811  * info.readonly = self.view.readonly
12812  * info.obj = self # <<<<<<<<<<<<<<
12813  *
12814  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
12815  */
12816  __Pyx_INCREF(((PyObject *)__pyx_v_self));
12817  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12818  __Pyx_GOTREF(__pyx_v_info->obj);
12819  __Pyx_DECREF(__pyx_v_info->obj);
12820  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
12821 
12822  /* "View.MemoryView":518
12823  *
12824  * @cname('getbuffer')
12825  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
12826  * if flags & PyBUF_WRITABLE and self.view.readonly:
12827  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12828  */
12829 
12830  /* function exit code */
12831  __pyx_r = 0;
12832  goto __pyx_L0;
12833  __pyx_L1_error:;
12834  __Pyx_XDECREF(__pyx_t_3);
12835  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12836  __pyx_r = -1;
12837  if (__pyx_v_info->obj != NULL) {
12838  __Pyx_GOTREF(__pyx_v_info->obj);
12839  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12840  }
12841  goto __pyx_L2;
12842  __pyx_L0:;
12843  if (__pyx_v_info->obj == Py_None) {
12844  __Pyx_GOTREF(__pyx_v_info->obj);
12845  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12846  }
12847  __pyx_L2:;
12848  __Pyx_TraceReturn(Py_None, 0);
12849  __Pyx_RefNannyFinishContext();
12850  return __pyx_r;
12851 }
12852 
12853 /* "View.MemoryView":553
12854  *
12855  * @property
12856  * def T(self): # <<<<<<<<<<<<<<
12857  * cdef _memoryviewslice result = memoryview_copy(self)
12858  * transpose_memslice(&result.from_slice)
12859  */
12860 
12861 /* Python wrapper */
12862 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
12863 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
12864  PyObject *__pyx_r = 0;
12865  __Pyx_RefNannyDeclarations
12866  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12867  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12868 
12869  /* function exit code */
12870  __Pyx_RefNannyFinishContext();
12871  return __pyx_r;
12872 }
12873 
12874 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12875  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
12876  PyObject *__pyx_r = NULL;
12877  __Pyx_TraceDeclarations
12878  __Pyx_RefNannyDeclarations
12879  PyObject *__pyx_t_1 = NULL;
12880  int __pyx_t_2;
12881  int __pyx_lineno = 0;
12882  const char *__pyx_filename = NULL;
12883  int __pyx_clineno = 0;
12884  __Pyx_RefNannySetupContext("__get__", 0);
12885  __Pyx_TraceCall("__get__", __pyx_f[1], 553, 0, __PYX_ERR(1, 553, __pyx_L1_error));
12886 
12887  /* "View.MemoryView":554
12888  * @property
12889  * def T(self):
12890  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
12891  * transpose_memslice(&result.from_slice)
12892  * return result
12893  */
12894  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
12895  __Pyx_GOTREF(__pyx_t_1);
12896  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
12897  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
12898  __pyx_t_1 = 0;
12899 
12900  /* "View.MemoryView":555
12901  * def T(self):
12902  * cdef _memoryviewslice result = memoryview_copy(self)
12903  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
12904  * return result
12905  *
12906  */
12907  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
12908 
12909  /* "View.MemoryView":556
12910  * cdef _memoryviewslice result = memoryview_copy(self)
12911  * transpose_memslice(&result.from_slice)
12912  * return result # <<<<<<<<<<<<<<
12913  *
12914  * @property
12915  */
12916  __Pyx_XDECREF(__pyx_r);
12917  __Pyx_INCREF(((PyObject *)__pyx_v_result));
12918  __pyx_r = ((PyObject *)__pyx_v_result);
12919  goto __pyx_L0;
12920 
12921  /* "View.MemoryView":553
12922  *
12923  * @property
12924  * def T(self): # <<<<<<<<<<<<<<
12925  * cdef _memoryviewslice result = memoryview_copy(self)
12926  * transpose_memslice(&result.from_slice)
12927  */
12928 
12929  /* function exit code */
12930  __pyx_L1_error:;
12931  __Pyx_XDECREF(__pyx_t_1);
12932  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12933  __pyx_r = NULL;
12934  __pyx_L0:;
12935  __Pyx_XDECREF((PyObject *)__pyx_v_result);
12936  __Pyx_XGIVEREF(__pyx_r);
12937  __Pyx_TraceReturn(__pyx_r, 0);
12938  __Pyx_RefNannyFinishContext();
12939  return __pyx_r;
12940 }
12941 
12942 /* "View.MemoryView":559
12943  *
12944  * @property
12945  * def base(self): # <<<<<<<<<<<<<<
12946  * return self.obj
12947  *
12948  */
12949 
12950 /* Python wrapper */
12951 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
12952 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
12953  PyObject *__pyx_r = 0;
12954  __Pyx_RefNannyDeclarations
12955  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12956  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12957 
12958  /* function exit code */
12959  __Pyx_RefNannyFinishContext();
12960  return __pyx_r;
12961 }
12962 
12963 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12964  PyObject *__pyx_r = NULL;
12965  __Pyx_TraceDeclarations
12966  __Pyx_RefNannyDeclarations
12967  int __pyx_lineno = 0;
12968  const char *__pyx_filename = NULL;
12969  int __pyx_clineno = 0;
12970  __Pyx_RefNannySetupContext("__get__", 0);
12971  __Pyx_TraceCall("__get__", __pyx_f[1], 559, 0, __PYX_ERR(1, 559, __pyx_L1_error));
12972 
12973  /* "View.MemoryView":560
12974  * @property
12975  * def base(self):
12976  * return self.obj # <<<<<<<<<<<<<<
12977  *
12978  * @property
12979  */
12980  __Pyx_XDECREF(__pyx_r);
12981  __Pyx_INCREF(__pyx_v_self->obj);
12982  __pyx_r = __pyx_v_self->obj;
12983  goto __pyx_L0;
12984 
12985  /* "View.MemoryView":559
12986  *
12987  * @property
12988  * def base(self): # <<<<<<<<<<<<<<
12989  * return self.obj
12990  *
12991  */
12992 
12993  /* function exit code */
12994  __pyx_L1_error:;
12995  __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12996  __pyx_r = NULL;
12997  __pyx_L0:;
12998  __Pyx_XGIVEREF(__pyx_r);
12999  __Pyx_TraceReturn(__pyx_r, 0);
13000  __Pyx_RefNannyFinishContext();
13001  return __pyx_r;
13002 }
13003 
13004 /* "View.MemoryView":563
13005  *
13006  * @property
13007  * def shape(self): # <<<<<<<<<<<<<<
13008  * return tuple([length for length in self.view.shape[:self.view.ndim]])
13009  *
13010  */
13011 
13012 /* Python wrapper */
13013 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
13014 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
13015  PyObject *__pyx_r = 0;
13016  __Pyx_RefNannyDeclarations
13017  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13018  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13019 
13020  /* function exit code */
13021  __Pyx_RefNannyFinishContext();
13022  return __pyx_r;
13023 }
13024 
13025 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13026  Py_ssize_t __pyx_v_length;
13027  PyObject *__pyx_r = NULL;
13028  __Pyx_TraceDeclarations
13029  __Pyx_RefNannyDeclarations
13030  PyObject *__pyx_t_1 = NULL;
13031  Py_ssize_t *__pyx_t_2;
13032  Py_ssize_t *__pyx_t_3;
13033  Py_ssize_t *__pyx_t_4;
13034  PyObject *__pyx_t_5 = NULL;
13035  int __pyx_lineno = 0;
13036  const char *__pyx_filename = NULL;
13037  int __pyx_clineno = 0;
13038  __Pyx_RefNannySetupContext("__get__", 0);
13039  __Pyx_TraceCall("__get__", __pyx_f[1], 563, 0, __PYX_ERR(1, 563, __pyx_L1_error));
13040 
13041  /* "View.MemoryView":564
13042  * @property
13043  * def shape(self):
13044  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
13045  *
13046  * @property
13047  */
13048  __Pyx_XDECREF(__pyx_r);
13049  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
13050  __Pyx_GOTREF(__pyx_t_1);
13051  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13052  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
13053  __pyx_t_2 = __pyx_t_4;
13054  __pyx_v_length = (__pyx_t_2[0]);
13055  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
13056  __Pyx_GOTREF(__pyx_t_5);
13057  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
13058  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13059  }
13060  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
13061  __Pyx_GOTREF(__pyx_t_5);
13062  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13063  __pyx_r = __pyx_t_5;
13064  __pyx_t_5 = 0;
13065  goto __pyx_L0;
13066 
13067  /* "View.MemoryView":563
13068  *
13069  * @property
13070  * def shape(self): # <<<<<<<<<<<<<<
13071  * return tuple([length for length in self.view.shape[:self.view.ndim]])
13072  *
13073  */
13074 
13075  /* function exit code */
13076  __pyx_L1_error:;
13077  __Pyx_XDECREF(__pyx_t_1);
13078  __Pyx_XDECREF(__pyx_t_5);
13079  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13080  __pyx_r = NULL;
13081  __pyx_L0:;
13082  __Pyx_XGIVEREF(__pyx_r);
13083  __Pyx_TraceReturn(__pyx_r, 0);
13084  __Pyx_RefNannyFinishContext();
13085  return __pyx_r;
13086 }
13087 
13088 /* "View.MemoryView":567
13089  *
13090  * @property
13091  * def strides(self): # <<<<<<<<<<<<<<
13092  * if self.view.strides == NULL:
13093  *
13094  */
13095 
13096 /* Python wrapper */
13097 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
13098 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
13099  PyObject *__pyx_r = 0;
13100  __Pyx_RefNannyDeclarations
13101  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13102  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13103 
13104  /* function exit code */
13105  __Pyx_RefNannyFinishContext();
13106  return __pyx_r;
13107 }
13108 
13109 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13110  Py_ssize_t __pyx_v_stride;
13111  PyObject *__pyx_r = NULL;
13112  __Pyx_TraceDeclarations
13113  __Pyx_RefNannyDeclarations
13114  int __pyx_t_1;
13115  PyObject *__pyx_t_2 = NULL;
13116  Py_ssize_t *__pyx_t_3;
13117  Py_ssize_t *__pyx_t_4;
13118  Py_ssize_t *__pyx_t_5;
13119  PyObject *__pyx_t_6 = NULL;
13120  int __pyx_lineno = 0;
13121  const char *__pyx_filename = NULL;
13122  int __pyx_clineno = 0;
13123  __Pyx_RefNannySetupContext("__get__", 0);
13124  __Pyx_TraceCall("__get__", __pyx_f[1], 567, 0, __PYX_ERR(1, 567, __pyx_L1_error));
13125 
13126  /* "View.MemoryView":568
13127  * @property
13128  * def strides(self):
13129  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13130  *
13131  * raise ValueError("Buffer view does not expose strides")
13132  */
13133  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
13134  if (unlikely(__pyx_t_1)) {
13135 
13136  /* "View.MemoryView":570
13137  * if self.view.strides == NULL:
13138  *
13139  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
13140  *
13141  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
13142  */
13143  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
13144  __Pyx_GOTREF(__pyx_t_2);
13145  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
13146  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13147  __PYX_ERR(1, 570, __pyx_L1_error)
13148 
13149  /* "View.MemoryView":568
13150  * @property
13151  * def strides(self):
13152  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13153  *
13154  * raise ValueError("Buffer view does not expose strides")
13155  */
13156  }
13157 
13158  /* "View.MemoryView":572
13159  * raise ValueError("Buffer view does not expose strides")
13160  *
13161  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
13162  *
13163  * @property
13164  */
13165  __Pyx_XDECREF(__pyx_r);
13166  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
13167  __Pyx_GOTREF(__pyx_t_2);
13168  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
13169  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13170  __pyx_t_3 = __pyx_t_5;
13171  __pyx_v_stride = (__pyx_t_3[0]);
13172  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13173  __Pyx_GOTREF(__pyx_t_6);
13174  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
13175  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13176  }
13177  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13178  __Pyx_GOTREF(__pyx_t_6);
13179  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13180  __pyx_r = __pyx_t_6;
13181  __pyx_t_6 = 0;
13182  goto __pyx_L0;
13183 
13184  /* "View.MemoryView":567
13185  *
13186  * @property
13187  * def strides(self): # <<<<<<<<<<<<<<
13188  * if self.view.strides == NULL:
13189  *
13190  */
13191 
13192  /* function exit code */
13193  __pyx_L1_error:;
13194  __Pyx_XDECREF(__pyx_t_2);
13195  __Pyx_XDECREF(__pyx_t_6);
13196  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13197  __pyx_r = NULL;
13198  __pyx_L0:;
13199  __Pyx_XGIVEREF(__pyx_r);
13200  __Pyx_TraceReturn(__pyx_r, 0);
13201  __Pyx_RefNannyFinishContext();
13202  return __pyx_r;
13203 }
13204 
13205 /* "View.MemoryView":575
13206  *
13207  * @property
13208  * def suboffsets(self): # <<<<<<<<<<<<<<
13209  * if self.view.suboffsets == NULL:
13210  * return (-1,) * self.view.ndim
13211  */
13212 
13213 /* Python wrapper */
13214 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
13215 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
13216  PyObject *__pyx_r = 0;
13217  __Pyx_RefNannyDeclarations
13218  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13219  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13220 
13221  /* function exit code */
13222  __Pyx_RefNannyFinishContext();
13223  return __pyx_r;
13224 }
13225 
13226 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13227  Py_ssize_t __pyx_v_suboffset;
13228  PyObject *__pyx_r = NULL;
13229  __Pyx_TraceDeclarations
13230  __Pyx_RefNannyDeclarations
13231  int __pyx_t_1;
13232  PyObject *__pyx_t_2 = NULL;
13233  PyObject *__pyx_t_3 = NULL;
13234  Py_ssize_t *__pyx_t_4;
13235  Py_ssize_t *__pyx_t_5;
13236  Py_ssize_t *__pyx_t_6;
13237  int __pyx_lineno = 0;
13238  const char *__pyx_filename = NULL;
13239  int __pyx_clineno = 0;
13240  __Pyx_RefNannySetupContext("__get__", 0);
13241  __Pyx_TraceCall("__get__", __pyx_f[1], 575, 0, __PYX_ERR(1, 575, __pyx_L1_error));
13242 
13243  /* "View.MemoryView":576
13244  * @property
13245  * def suboffsets(self):
13246  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13247  * return (-1,) * self.view.ndim
13248  *
13249  */
13250  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
13251  if (__pyx_t_1) {
13252 
13253  /* "View.MemoryView":577
13254  * def suboffsets(self):
13255  * if self.view.suboffsets == NULL:
13256  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
13257  *
13258  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
13259  */
13260  __Pyx_XDECREF(__pyx_r);
13261  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
13262  __Pyx_GOTREF(__pyx_t_2);
13263  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__28, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
13264  __Pyx_GOTREF(__pyx_t_3);
13265  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13266  __pyx_r = __pyx_t_3;
13267  __pyx_t_3 = 0;
13268  goto __pyx_L0;
13269 
13270  /* "View.MemoryView":576
13271  * @property
13272  * def suboffsets(self):
13273  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13274  * return (-1,) * self.view.ndim
13275  *
13276  */
13277  }
13278 
13279  /* "View.MemoryView":579
13280  * return (-1,) * self.view.ndim
13281  *
13282  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
13283  *
13284  * @property
13285  */
13286  __Pyx_XDECREF(__pyx_r);
13287  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
13288  __Pyx_GOTREF(__pyx_t_3);
13289  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
13290  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
13291  __pyx_t_4 = __pyx_t_6;
13292  __pyx_v_suboffset = (__pyx_t_4[0]);
13293  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
13294  __Pyx_GOTREF(__pyx_t_2);
13295  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
13296  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13297  }
13298  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
13299  __Pyx_GOTREF(__pyx_t_2);
13300  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13301  __pyx_r = __pyx_t_2;
13302  __pyx_t_2 = 0;
13303  goto __pyx_L0;
13304 
13305  /* "View.MemoryView":575
13306  *
13307  * @property
13308  * def suboffsets(self): # <<<<<<<<<<<<<<
13309  * if self.view.suboffsets == NULL:
13310  * return (-1,) * self.view.ndim
13311  */
13312 
13313  /* function exit code */
13314  __pyx_L1_error:;
13315  __Pyx_XDECREF(__pyx_t_2);
13316  __Pyx_XDECREF(__pyx_t_3);
13317  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13318  __pyx_r = NULL;
13319  __pyx_L0:;
13320  __Pyx_XGIVEREF(__pyx_r);
13321  __Pyx_TraceReturn(__pyx_r, 0);
13322  __Pyx_RefNannyFinishContext();
13323  return __pyx_r;
13324 }
13325 
13326 /* "View.MemoryView":582
13327  *
13328  * @property
13329  * def ndim(self): # <<<<<<<<<<<<<<
13330  * return self.view.ndim
13331  *
13332  */
13333 
13334 /* Python wrapper */
13335 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
13336 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
13337  PyObject *__pyx_r = 0;
13338  __Pyx_RefNannyDeclarations
13339  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13340  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13341 
13342  /* function exit code */
13343  __Pyx_RefNannyFinishContext();
13344  return __pyx_r;
13345 }
13346 
13347 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13348  PyObject *__pyx_r = NULL;
13349  __Pyx_TraceDeclarations
13350  __Pyx_RefNannyDeclarations
13351  PyObject *__pyx_t_1 = NULL;
13352  int __pyx_lineno = 0;
13353  const char *__pyx_filename = NULL;
13354  int __pyx_clineno = 0;
13355  __Pyx_RefNannySetupContext("__get__", 0);
13356  __Pyx_TraceCall("__get__", __pyx_f[1], 582, 0, __PYX_ERR(1, 582, __pyx_L1_error));
13357 
13358  /* "View.MemoryView":583
13359  * @property
13360  * def ndim(self):
13361  * return self.view.ndim # <<<<<<<<<<<<<<
13362  *
13363  * @property
13364  */
13365  __Pyx_XDECREF(__pyx_r);
13366  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
13367  __Pyx_GOTREF(__pyx_t_1);
13368  __pyx_r = __pyx_t_1;
13369  __pyx_t_1 = 0;
13370  goto __pyx_L0;
13371 
13372  /* "View.MemoryView":582
13373  *
13374  * @property
13375  * def ndim(self): # <<<<<<<<<<<<<<
13376  * return self.view.ndim
13377  *
13378  */
13379 
13380  /* function exit code */
13381  __pyx_L1_error:;
13382  __Pyx_XDECREF(__pyx_t_1);
13383  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13384  __pyx_r = NULL;
13385  __pyx_L0:;
13386  __Pyx_XGIVEREF(__pyx_r);
13387  __Pyx_TraceReturn(__pyx_r, 0);
13388  __Pyx_RefNannyFinishContext();
13389  return __pyx_r;
13390 }
13391 
13392 /* "View.MemoryView":586
13393  *
13394  * @property
13395  * def itemsize(self): # <<<<<<<<<<<<<<
13396  * return self.view.itemsize
13397  *
13398  */
13399 
13400 /* Python wrapper */
13401 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
13402 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
13403  PyObject *__pyx_r = 0;
13404  __Pyx_RefNannyDeclarations
13405  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13406  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13407 
13408  /* function exit code */
13409  __Pyx_RefNannyFinishContext();
13410  return __pyx_r;
13411 }
13412 
13413 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13414  PyObject *__pyx_r = NULL;
13415  __Pyx_TraceDeclarations
13416  __Pyx_RefNannyDeclarations
13417  PyObject *__pyx_t_1 = NULL;
13418  int __pyx_lineno = 0;
13419  const char *__pyx_filename = NULL;
13420  int __pyx_clineno = 0;
13421  __Pyx_RefNannySetupContext("__get__", 0);
13422  __Pyx_TraceCall("__get__", __pyx_f[1], 586, 0, __PYX_ERR(1, 586, __pyx_L1_error));
13423 
13424  /* "View.MemoryView":587
13425  * @property
13426  * def itemsize(self):
13427  * return self.view.itemsize # <<<<<<<<<<<<<<
13428  *
13429  * @property
13430  */
13431  __Pyx_XDECREF(__pyx_r);
13432  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
13433  __Pyx_GOTREF(__pyx_t_1);
13434  __pyx_r = __pyx_t_1;
13435  __pyx_t_1 = 0;
13436  goto __pyx_L0;
13437 
13438  /* "View.MemoryView":586
13439  *
13440  * @property
13441  * def itemsize(self): # <<<<<<<<<<<<<<
13442  * return self.view.itemsize
13443  *
13444  */
13445 
13446  /* function exit code */
13447  __pyx_L1_error:;
13448  __Pyx_XDECREF(__pyx_t_1);
13449  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13450  __pyx_r = NULL;
13451  __pyx_L0:;
13452  __Pyx_XGIVEREF(__pyx_r);
13453  __Pyx_TraceReturn(__pyx_r, 0);
13454  __Pyx_RefNannyFinishContext();
13455  return __pyx_r;
13456 }
13457 
13458 /* "View.MemoryView":590
13459  *
13460  * @property
13461  * def nbytes(self): # <<<<<<<<<<<<<<
13462  * return self.size * self.view.itemsize
13463  *
13464  */
13465 
13466 /* Python wrapper */
13467 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
13468 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
13469  PyObject *__pyx_r = 0;
13470  __Pyx_RefNannyDeclarations
13471  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13472  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13473 
13474  /* function exit code */
13475  __Pyx_RefNannyFinishContext();
13476  return __pyx_r;
13477 }
13478 
13479 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13480  PyObject *__pyx_r = NULL;
13481  __Pyx_TraceDeclarations
13482  __Pyx_RefNannyDeclarations
13483  PyObject *__pyx_t_1 = NULL;
13484  PyObject *__pyx_t_2 = NULL;
13485  PyObject *__pyx_t_3 = NULL;
13486  int __pyx_lineno = 0;
13487  const char *__pyx_filename = NULL;
13488  int __pyx_clineno = 0;
13489  __Pyx_RefNannySetupContext("__get__", 0);
13490  __Pyx_TraceCall("__get__", __pyx_f[1], 590, 0, __PYX_ERR(1, 590, __pyx_L1_error));
13491 
13492  /* "View.MemoryView":591
13493  * @property
13494  * def nbytes(self):
13495  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
13496  *
13497  * @property
13498  */
13499  __Pyx_XDECREF(__pyx_r);
13500  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
13501  __Pyx_GOTREF(__pyx_t_1);
13502  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
13503  __Pyx_GOTREF(__pyx_t_2);
13504  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
13505  __Pyx_GOTREF(__pyx_t_3);
13506  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13507  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13508  __pyx_r = __pyx_t_3;
13509  __pyx_t_3 = 0;
13510  goto __pyx_L0;
13511 
13512  /* "View.MemoryView":590
13513  *
13514  * @property
13515  * def nbytes(self): # <<<<<<<<<<<<<<
13516  * return self.size * self.view.itemsize
13517  *
13518  */
13519 
13520  /* function exit code */
13521  __pyx_L1_error:;
13522  __Pyx_XDECREF(__pyx_t_1);
13523  __Pyx_XDECREF(__pyx_t_2);
13524  __Pyx_XDECREF(__pyx_t_3);
13525  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13526  __pyx_r = NULL;
13527  __pyx_L0:;
13528  __Pyx_XGIVEREF(__pyx_r);
13529  __Pyx_TraceReturn(__pyx_r, 0);
13530  __Pyx_RefNannyFinishContext();
13531  return __pyx_r;
13532 }
13533 
13534 /* "View.MemoryView":594
13535  *
13536  * @property
13537  * def size(self): # <<<<<<<<<<<<<<
13538  * if self._size is None:
13539  * result = 1
13540  */
13541 
13542 /* Python wrapper */
13543 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
13544 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
13545  PyObject *__pyx_r = 0;
13546  __Pyx_RefNannyDeclarations
13547  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13548  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13549 
13550  /* function exit code */
13551  __Pyx_RefNannyFinishContext();
13552  return __pyx_r;
13553 }
13554 
13555 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13556  PyObject *__pyx_v_result = NULL;
13557  PyObject *__pyx_v_length = NULL;
13558  PyObject *__pyx_r = NULL;
13559  __Pyx_TraceDeclarations
13560  __Pyx_RefNannyDeclarations
13561  int __pyx_t_1;
13562  int __pyx_t_2;
13563  Py_ssize_t *__pyx_t_3;
13564  Py_ssize_t *__pyx_t_4;
13565  Py_ssize_t *__pyx_t_5;
13566  PyObject *__pyx_t_6 = NULL;
13567  int __pyx_lineno = 0;
13568  const char *__pyx_filename = NULL;
13569  int __pyx_clineno = 0;
13570  __Pyx_RefNannySetupContext("__get__", 0);
13571  __Pyx_TraceCall("__get__", __pyx_f[1], 594, 0, __PYX_ERR(1, 594, __pyx_L1_error));
13572 
13573  /* "View.MemoryView":595
13574  * @property
13575  * def size(self):
13576  * if self._size is None: # <<<<<<<<<<<<<<
13577  * result = 1
13578  *
13579  */
13580  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
13581  __pyx_t_2 = (__pyx_t_1 != 0);
13582  if (__pyx_t_2) {
13583 
13584  /* "View.MemoryView":596
13585  * def size(self):
13586  * if self._size is None:
13587  * result = 1 # <<<<<<<<<<<<<<
13588  *
13589  * for length in self.view.shape[:self.view.ndim]:
13590  */
13591  __Pyx_INCREF(__pyx_int_1);
13592  __pyx_v_result = __pyx_int_1;
13593 
13594  /* "View.MemoryView":598
13595  * result = 1
13596  *
13597  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
13598  * result *= length
13599  *
13600  */
13601  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13602  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13603  __pyx_t_3 = __pyx_t_5;
13604  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
13605  __Pyx_GOTREF(__pyx_t_6);
13606  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
13607  __pyx_t_6 = 0;
13608 
13609  /* "View.MemoryView":599
13610  *
13611  * for length in self.view.shape[:self.view.ndim]:
13612  * result *= length # <<<<<<<<<<<<<<
13613  *
13614  * self._size = result
13615  */
13616  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
13617  __Pyx_GOTREF(__pyx_t_6);
13618  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
13619  __pyx_t_6 = 0;
13620  }
13621 
13622  /* "View.MemoryView":601
13623  * result *= length
13624  *
13625  * self._size = result # <<<<<<<<<<<<<<
13626  *
13627  * return self._size
13628  */
13629  __Pyx_INCREF(__pyx_v_result);
13630  __Pyx_GIVEREF(__pyx_v_result);
13631  __Pyx_GOTREF(__pyx_v_self->_size);
13632  __Pyx_DECREF(__pyx_v_self->_size);
13633  __pyx_v_self->_size = __pyx_v_result;
13634 
13635  /* "View.MemoryView":595
13636  * @property
13637  * def size(self):
13638  * if self._size is None: # <<<<<<<<<<<<<<
13639  * result = 1
13640  *
13641  */
13642  }
13643 
13644  /* "View.MemoryView":603
13645  * self._size = result
13646  *
13647  * return self._size # <<<<<<<<<<<<<<
13648  *
13649  * def __len__(self):
13650  */
13651  __Pyx_XDECREF(__pyx_r);
13652  __Pyx_INCREF(__pyx_v_self->_size);
13653  __pyx_r = __pyx_v_self->_size;
13654  goto __pyx_L0;
13655 
13656  /* "View.MemoryView":594
13657  *
13658  * @property
13659  * def size(self): # <<<<<<<<<<<<<<
13660  * if self._size is None:
13661  * result = 1
13662  */
13663 
13664  /* function exit code */
13665  __pyx_L1_error:;
13666  __Pyx_XDECREF(__pyx_t_6);
13667  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13668  __pyx_r = NULL;
13669  __pyx_L0:;
13670  __Pyx_XDECREF(__pyx_v_result);
13671  __Pyx_XDECREF(__pyx_v_length);
13672  __Pyx_XGIVEREF(__pyx_r);
13673  __Pyx_TraceReturn(__pyx_r, 0);
13674  __Pyx_RefNannyFinishContext();
13675  return __pyx_r;
13676 }
13677 
13678 /* "View.MemoryView":605
13679  * return self._size
13680  *
13681  * def __len__(self): # <<<<<<<<<<<<<<
13682  * if self.view.ndim >= 1:
13683  * return self.view.shape[0]
13684  */
13685 
13686 /* Python wrapper */
13687 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
13688 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
13689  Py_ssize_t __pyx_r;
13690  __Pyx_RefNannyDeclarations
13691  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
13692  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13693 
13694  /* function exit code */
13695  __Pyx_RefNannyFinishContext();
13696  return __pyx_r;
13697 }
13698 
13699 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
13700  Py_ssize_t __pyx_r;
13701  __Pyx_TraceDeclarations
13702  __Pyx_RefNannyDeclarations
13703  int __pyx_t_1;
13704  int __pyx_lineno = 0;
13705  const char *__pyx_filename = NULL;
13706  int __pyx_clineno = 0;
13707  __Pyx_RefNannySetupContext("__len__", 0);
13708  __Pyx_TraceCall("__len__", __pyx_f[1], 605, 0, __PYX_ERR(1, 605, __pyx_L1_error));
13709 
13710  /* "View.MemoryView":606
13711  *
13712  * def __len__(self):
13713  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
13714  * return self.view.shape[0]
13715  *
13716  */
13717  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
13718  if (__pyx_t_1) {
13719 
13720  /* "View.MemoryView":607
13721  * def __len__(self):
13722  * if self.view.ndim >= 1:
13723  * return self.view.shape[0] # <<<<<<<<<<<<<<
13724  *
13725  * return 0
13726  */
13727  __pyx_r = (__pyx_v_self->view.shape[0]);
13728  goto __pyx_L0;
13729 
13730  /* "View.MemoryView":606
13731  *
13732  * def __len__(self):
13733  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
13734  * return self.view.shape[0]
13735  *
13736  */
13737  }
13738 
13739  /* "View.MemoryView":609
13740  * return self.view.shape[0]
13741  *
13742  * return 0 # <<<<<<<<<<<<<<
13743  *
13744  * def __repr__(self):
13745  */
13746  __pyx_r = 0;
13747  goto __pyx_L0;
13748 
13749  /* "View.MemoryView":605
13750  * return self._size
13751  *
13752  * def __len__(self): # <<<<<<<<<<<<<<
13753  * if self.view.ndim >= 1:
13754  * return self.view.shape[0]
13755  */
13756 
13757  /* function exit code */
13758  __pyx_L1_error:;
13759  __Pyx_AddTraceback("View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13760  __pyx_r = -1;
13761  __pyx_L0:;
13762  __Pyx_TraceReturn(Py_None, 0);
13763  __Pyx_RefNannyFinishContext();
13764  return __pyx_r;
13765 }
13766 
13767 /* "View.MemoryView":611
13768  * return 0
13769  *
13770  * def __repr__(self): # <<<<<<<<<<<<<<
13771  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13772  * id(self))
13773  */
13774 
13775 /* Python wrapper */
13776 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
13777 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
13778  PyObject *__pyx_r = 0;
13779  __Pyx_RefNannyDeclarations
13780  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
13781  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13782 
13783  /* function exit code */
13784  __Pyx_RefNannyFinishContext();
13785  return __pyx_r;
13786 }
13787 
13788 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
13789  PyObject *__pyx_r = NULL;
13790  __Pyx_TraceDeclarations
13791  __Pyx_RefNannyDeclarations
13792  PyObject *__pyx_t_1 = NULL;
13793  PyObject *__pyx_t_2 = NULL;
13794  PyObject *__pyx_t_3 = NULL;
13795  int __pyx_lineno = 0;
13796  const char *__pyx_filename = NULL;
13797  int __pyx_clineno = 0;
13798  __Pyx_RefNannySetupContext("__repr__", 0);
13799  __Pyx_TraceCall("__repr__", __pyx_f[1], 611, 0, __PYX_ERR(1, 611, __pyx_L1_error));
13800 
13801  /* "View.MemoryView":612
13802  *
13803  * def __repr__(self):
13804  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
13805  * id(self))
13806  *
13807  */
13808  __Pyx_XDECREF(__pyx_r);
13809  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
13810  __Pyx_GOTREF(__pyx_t_1);
13811  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
13812  __Pyx_GOTREF(__pyx_t_2);
13813  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13814  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
13815  __Pyx_GOTREF(__pyx_t_1);
13816  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13817 
13818  /* "View.MemoryView":613
13819  * def __repr__(self):
13820  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13821  * id(self)) # <<<<<<<<<<<<<<
13822  *
13823  * def __str__(self):
13824  */
13825  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
13826  __Pyx_GOTREF(__pyx_t_2);
13827 
13828  /* "View.MemoryView":612
13829  *
13830  * def __repr__(self):
13831  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
13832  * id(self))
13833  *
13834  */
13835  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
13836  __Pyx_GOTREF(__pyx_t_3);
13837  __Pyx_GIVEREF(__pyx_t_1);
13838  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
13839  __Pyx_GIVEREF(__pyx_t_2);
13840  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
13841  __pyx_t_1 = 0;
13842  __pyx_t_2 = 0;
13843  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
13844  __Pyx_GOTREF(__pyx_t_2);
13845  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13846  __pyx_r = __pyx_t_2;
13847  __pyx_t_2 = 0;
13848  goto __pyx_L0;
13849 
13850  /* "View.MemoryView":611
13851  * return 0
13852  *
13853  * def __repr__(self): # <<<<<<<<<<<<<<
13854  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13855  * id(self))
13856  */
13857 
13858  /* function exit code */
13859  __pyx_L1_error:;
13860  __Pyx_XDECREF(__pyx_t_1);
13861  __Pyx_XDECREF(__pyx_t_2);
13862  __Pyx_XDECREF(__pyx_t_3);
13863  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13864  __pyx_r = NULL;
13865  __pyx_L0:;
13866  __Pyx_XGIVEREF(__pyx_r);
13867  __Pyx_TraceReturn(__pyx_r, 0);
13868  __Pyx_RefNannyFinishContext();
13869  return __pyx_r;
13870 }
13871 
13872 /* "View.MemoryView":615
13873  * id(self))
13874  *
13875  * def __str__(self): # <<<<<<<<<<<<<<
13876  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
13877  *
13878  */
13879 
13880 /* Python wrapper */
13881 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
13882 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
13883  PyObject *__pyx_r = 0;
13884  __Pyx_RefNannyDeclarations
13885  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
13886  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13887 
13888  /* function exit code */
13889  __Pyx_RefNannyFinishContext();
13890  return __pyx_r;
13891 }
13892 
13893 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
13894  PyObject *__pyx_r = NULL;
13895  __Pyx_TraceDeclarations
13896  __Pyx_RefNannyDeclarations
13897  PyObject *__pyx_t_1 = NULL;
13898  PyObject *__pyx_t_2 = NULL;
13899  int __pyx_lineno = 0;
13900  const char *__pyx_filename = NULL;
13901  int __pyx_clineno = 0;
13902  __Pyx_RefNannySetupContext("__str__", 0);
13903  __Pyx_TraceCall("__str__", __pyx_f[1], 615, 0, __PYX_ERR(1, 615, __pyx_L1_error));
13904 
13905  /* "View.MemoryView":616
13906  *
13907  * def __str__(self):
13908  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
13909  *
13910  *
13911  */
13912  __Pyx_XDECREF(__pyx_r);
13913  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
13914  __Pyx_GOTREF(__pyx_t_1);
13915  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
13916  __Pyx_GOTREF(__pyx_t_2);
13917  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13918  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
13919  __Pyx_GOTREF(__pyx_t_1);
13920  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13921  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
13922  __Pyx_GOTREF(__pyx_t_2);
13923  __Pyx_GIVEREF(__pyx_t_1);
13924  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
13925  __pyx_t_1 = 0;
13926  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
13927  __Pyx_GOTREF(__pyx_t_1);
13928  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13929  __pyx_r = __pyx_t_1;
13930  __pyx_t_1 = 0;
13931  goto __pyx_L0;
13932 
13933  /* "View.MemoryView":615
13934  * id(self))
13935  *
13936  * def __str__(self): # <<<<<<<<<<<<<<
13937  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
13938  *
13939  */
13940 
13941  /* function exit code */
13942  __pyx_L1_error:;
13943  __Pyx_XDECREF(__pyx_t_1);
13944  __Pyx_XDECREF(__pyx_t_2);
13945  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13946  __pyx_r = NULL;
13947  __pyx_L0:;
13948  __Pyx_XGIVEREF(__pyx_r);
13949  __Pyx_TraceReturn(__pyx_r, 0);
13950  __Pyx_RefNannyFinishContext();
13951  return __pyx_r;
13952 }
13953 
13954 /* "View.MemoryView":619
13955  *
13956  *
13957  * def is_c_contig(self): # <<<<<<<<<<<<<<
13958  * cdef __Pyx_memviewslice *mslice
13959  * cdef __Pyx_memviewslice tmp
13960  */
13961 
13962 /* Python wrapper */
13963 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13964 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
13965 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13966  PyObject *__pyx_r = 0;
13967  __Pyx_RefNannyDeclarations
13968  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
13969  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
13970 
13971  /* function exit code */
13972  __Pyx_RefNannyFinishContext();
13973  return __pyx_r;
13974 }
13975 
13976 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
13977  __Pyx_memviewslice *__pyx_v_mslice;
13978  __Pyx_memviewslice __pyx_v_tmp;
13979  PyObject *__pyx_r = NULL;
13980  __Pyx_TraceDeclarations
13981  __Pyx_RefNannyDeclarations
13982  __Pyx_memviewslice *__pyx_t_1;
13983  PyObject *__pyx_t_2 = NULL;
13984  int __pyx_lineno = 0;
13985  const char *__pyx_filename = NULL;
13986  int __pyx_clineno = 0;
13987  __Pyx_RefNannySetupContext("is_c_contig", 0);
13988  __Pyx_TraceCall("is_c_contig", __pyx_f[1], 619, 0, __PYX_ERR(1, 619, __pyx_L1_error));
13989 
13990  /* "View.MemoryView":622
13991  * cdef __Pyx_memviewslice *mslice
13992  * cdef __Pyx_memviewslice tmp
13993  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
13994  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
13995  *
13996  */
13997  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error)
13998  __pyx_v_mslice = __pyx_t_1;
13999 
14000  /* "View.MemoryView":623
14001  * cdef __Pyx_memviewslice tmp
14002  * mslice = get_slice_from_memview(self, &tmp)
14003  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
14004  *
14005  * def is_f_contig(self):
14006  */
14007  __Pyx_XDECREF(__pyx_r);
14008  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error)
14009  __Pyx_GOTREF(__pyx_t_2);
14010  __pyx_r = __pyx_t_2;
14011  __pyx_t_2 = 0;
14012  goto __pyx_L0;
14013 
14014  /* "View.MemoryView":619
14015  *
14016  *
14017  * def is_c_contig(self): # <<<<<<<<<<<<<<
14018  * cdef __Pyx_memviewslice *mslice
14019  * cdef __Pyx_memviewslice tmp
14020  */
14021 
14022  /* function exit code */
14023  __pyx_L1_error:;
14024  __Pyx_XDECREF(__pyx_t_2);
14025  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14026  __pyx_r = NULL;
14027  __pyx_L0:;
14028  __Pyx_XGIVEREF(__pyx_r);
14029  __Pyx_TraceReturn(__pyx_r, 0);
14030  __Pyx_RefNannyFinishContext();
14031  return __pyx_r;
14032 }
14033 
14034 /* "View.MemoryView":625
14035  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14036  *
14037  * def is_f_contig(self): # <<<<<<<<<<<<<<
14038  * cdef __Pyx_memviewslice *mslice
14039  * cdef __Pyx_memviewslice tmp
14040  */
14041 
14042 /* Python wrapper */
14043 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14044 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
14045 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14046  PyObject *__pyx_r = 0;
14047  __Pyx_RefNannyDeclarations
14048  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
14049  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14050 
14051  /* function exit code */
14052  __Pyx_RefNannyFinishContext();
14053  return __pyx_r;
14054 }
14055 
14056 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14057  __Pyx_memviewslice *__pyx_v_mslice;
14058  __Pyx_memviewslice __pyx_v_tmp;
14059  PyObject *__pyx_r = NULL;
14060  __Pyx_TraceDeclarations
14061  __Pyx_RefNannyDeclarations
14062  __Pyx_memviewslice *__pyx_t_1;
14063  PyObject *__pyx_t_2 = NULL;
14064  int __pyx_lineno = 0;
14065  const char *__pyx_filename = NULL;
14066  int __pyx_clineno = 0;
14067  __Pyx_RefNannySetupContext("is_f_contig", 0);
14068  __Pyx_TraceCall("is_f_contig", __pyx_f[1], 625, 0, __PYX_ERR(1, 625, __pyx_L1_error));
14069 
14070  /* "View.MemoryView":628
14071  * cdef __Pyx_memviewslice *mslice
14072  * cdef __Pyx_memviewslice tmp
14073  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14074  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14075  *
14076  */
14077  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error)
14078  __pyx_v_mslice = __pyx_t_1;
14079 
14080  /* "View.MemoryView":629
14081  * cdef __Pyx_memviewslice tmp
14082  * mslice = get_slice_from_memview(self, &tmp)
14083  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
14084  *
14085  * def copy(self):
14086  */
14087  __Pyx_XDECREF(__pyx_r);
14088  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
14089  __Pyx_GOTREF(__pyx_t_2);
14090  __pyx_r = __pyx_t_2;
14091  __pyx_t_2 = 0;
14092  goto __pyx_L0;
14093 
14094  /* "View.MemoryView":625
14095  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14096  *
14097  * def is_f_contig(self): # <<<<<<<<<<<<<<
14098  * cdef __Pyx_memviewslice *mslice
14099  * cdef __Pyx_memviewslice tmp
14100  */
14101 
14102  /* function exit code */
14103  __pyx_L1_error:;
14104  __Pyx_XDECREF(__pyx_t_2);
14105  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14106  __pyx_r = NULL;
14107  __pyx_L0:;
14108  __Pyx_XGIVEREF(__pyx_r);
14109  __Pyx_TraceReturn(__pyx_r, 0);
14110  __Pyx_RefNannyFinishContext();
14111  return __pyx_r;
14112 }
14113 
14114 /* "View.MemoryView":631
14115  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14116  *
14117  * def copy(self): # <<<<<<<<<<<<<<
14118  * cdef __Pyx_memviewslice mslice
14119  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14120  */
14121 
14122 /* Python wrapper */
14123 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14124 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
14125 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14126  PyObject *__pyx_r = 0;
14127  __Pyx_RefNannyDeclarations
14128  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
14129  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
14130 
14131  /* function exit code */
14132  __Pyx_RefNannyFinishContext();
14133  return __pyx_r;
14134 }
14135 
14136 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
14137  __Pyx_memviewslice __pyx_v_mslice;
14138  int __pyx_v_flags;
14139  PyObject *__pyx_r = NULL;
14140  __Pyx_TraceDeclarations
14141  __Pyx_RefNannyDeclarations
14142  __Pyx_memviewslice __pyx_t_1;
14143  PyObject *__pyx_t_2 = NULL;
14144  int __pyx_lineno = 0;
14145  const char *__pyx_filename = NULL;
14146  int __pyx_clineno = 0;
14147  __Pyx_RefNannySetupContext("copy", 0);
14148  __Pyx_TraceCall("copy", __pyx_f[1], 631, 0, __PYX_ERR(1, 631, __pyx_L1_error));
14149 
14150  /* "View.MemoryView":633
14151  * def copy(self):
14152  * cdef __Pyx_memviewslice mslice
14153  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
14154  *
14155  * slice_copy(self, &mslice)
14156  */
14157  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
14158 
14159  /* "View.MemoryView":635
14160  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14161  *
14162  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
14163  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
14164  * self.view.itemsize,
14165  */
14166  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
14167 
14168  /* "View.MemoryView":636
14169  *
14170  * slice_copy(self, &mslice)
14171  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
14172  * self.view.itemsize,
14173  * flags|PyBUF_C_CONTIGUOUS,
14174  */
14175  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error)
14176  __pyx_v_mslice = __pyx_t_1;
14177 
14178  /* "View.MemoryView":641
14179  * self.dtype_is_object)
14180  *
14181  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
14182  *
14183  * def copy_fortran(self):
14184  */
14185  __Pyx_XDECREF(__pyx_r);
14186  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
14187  __Pyx_GOTREF(__pyx_t_2);
14188  __pyx_r = __pyx_t_2;
14189  __pyx_t_2 = 0;
14190  goto __pyx_L0;
14191 
14192  /* "View.MemoryView":631
14193  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14194  *
14195  * def copy(self): # <<<<<<<<<<<<<<
14196  * cdef __Pyx_memviewslice mslice
14197  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14198  */
14199 
14200  /* function exit code */
14201  __pyx_L1_error:;
14202  __Pyx_XDECREF(__pyx_t_2);
14203  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
14204  __pyx_r = NULL;
14205  __pyx_L0:;
14206  __Pyx_XGIVEREF(__pyx_r);
14207  __Pyx_TraceReturn(__pyx_r, 0);
14208  __Pyx_RefNannyFinishContext();
14209  return __pyx_r;
14210 }
14211 
14212 /* "View.MemoryView":643
14213  * return memoryview_copy_from_slice(self, &mslice)
14214  *
14215  * def copy_fortran(self): # <<<<<<<<<<<<<<
14216  * cdef __Pyx_memviewslice src, dst
14217  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14218  */
14219 
14220 /* Python wrapper */
14221 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14222 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
14223 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14224  PyObject *__pyx_r = 0;
14225  __Pyx_RefNannyDeclarations
14226  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
14227  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
14228 
14229  /* function exit code */
14230  __Pyx_RefNannyFinishContext();
14231  return __pyx_r;
14232 }
14233 
14234 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
14235  __Pyx_memviewslice __pyx_v_src;
14236  __Pyx_memviewslice __pyx_v_dst;
14237  int __pyx_v_flags;
14238  PyObject *__pyx_r = NULL;
14239  __Pyx_TraceDeclarations
14240  __Pyx_RefNannyDeclarations
14241  __Pyx_memviewslice __pyx_t_1;
14242  PyObject *__pyx_t_2 = NULL;
14243  int __pyx_lineno = 0;
14244  const char *__pyx_filename = NULL;
14245  int __pyx_clineno = 0;
14246  __Pyx_RefNannySetupContext("copy_fortran", 0);
14247  __Pyx_TraceCall("copy_fortran", __pyx_f[1], 643, 0, __PYX_ERR(1, 643, __pyx_L1_error));
14248 
14249  /* "View.MemoryView":645
14250  * def copy_fortran(self):
14251  * cdef __Pyx_memviewslice src, dst
14252  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
14253  *
14254  * slice_copy(self, &src)
14255  */
14256  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
14257 
14258  /* "View.MemoryView":647
14259  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14260  *
14261  * slice_copy(self, &src) # <<<<<<<<<<<<<<
14262  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
14263  * self.view.itemsize,
14264  */
14265  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
14266 
14267  /* "View.MemoryView":648
14268  *
14269  * slice_copy(self, &src)
14270  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
14271  * self.view.itemsize,
14272  * flags|PyBUF_F_CONTIGUOUS,
14273  */
14274  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error)
14275  __pyx_v_dst = __pyx_t_1;
14276 
14277  /* "View.MemoryView":653
14278  * self.dtype_is_object)
14279  *
14280  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
14281  *
14282  *
14283  */
14284  __Pyx_XDECREF(__pyx_r);
14285  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
14286  __Pyx_GOTREF(__pyx_t_2);
14287  __pyx_r = __pyx_t_2;
14288  __pyx_t_2 = 0;
14289  goto __pyx_L0;
14290 
14291  /* "View.MemoryView":643
14292  * return memoryview_copy_from_slice(self, &mslice)
14293  *
14294  * def copy_fortran(self): # <<<<<<<<<<<<<<
14295  * cdef __Pyx_memviewslice src, dst
14296  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14297  */
14298 
14299  /* function exit code */
14300  __pyx_L1_error:;
14301  __Pyx_XDECREF(__pyx_t_2);
14302  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
14303  __pyx_r = NULL;
14304  __pyx_L0:;
14305  __Pyx_XGIVEREF(__pyx_r);
14306  __Pyx_TraceReturn(__pyx_r, 0);
14307  __Pyx_RefNannyFinishContext();
14308  return __pyx_r;
14309 }
14310 
14311 /* "(tree fragment)":1
14312  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14313  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14314  * def __setstate_cython__(self, __pyx_state):
14315  */
14316 
14317 /* Python wrapper */
14318 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14319 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
14320 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14321  PyObject *__pyx_r = 0;
14322  __Pyx_RefNannyDeclarations
14323  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14324  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14325 
14326  /* function exit code */
14327  __Pyx_RefNannyFinishContext();
14328  return __pyx_r;
14329 }
14330 
14331 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
14332  PyObject *__pyx_r = NULL;
14333  __Pyx_TraceDeclarations
14334  __Pyx_RefNannyDeclarations
14335  PyObject *__pyx_t_1 = NULL;
14336  int __pyx_lineno = 0;
14337  const char *__pyx_filename = NULL;
14338  int __pyx_clineno = 0;
14339  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
14340  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
14341 
14342  /* "(tree fragment)":2
14343  * def __reduce_cython__(self):
14344  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14345  * def __setstate_cython__(self, __pyx_state):
14346  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14347  */
14348  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
14349  __Pyx_GOTREF(__pyx_t_1);
14350  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14351  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14352  __PYX_ERR(1, 2, __pyx_L1_error)
14353 
14354  /* "(tree fragment)":1
14355  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14356  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14357  * def __setstate_cython__(self, __pyx_state):
14358  */
14359 
14360  /* function exit code */
14361  __pyx_L1_error:;
14362  __Pyx_XDECREF(__pyx_t_1);
14363  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14364  __pyx_r = NULL;
14365  __Pyx_XGIVEREF(__pyx_r);
14366  __Pyx_TraceReturn(__pyx_r, 0);
14367  __Pyx_RefNannyFinishContext();
14368  return __pyx_r;
14369 }
14370 
14371 /* "(tree fragment)":3
14372  * def __reduce_cython__(self):
14373  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14374  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14375  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14376  */
14377 
14378 /* Python wrapper */
14379 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
14380 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
14381 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14382  PyObject *__pyx_r = 0;
14383  __Pyx_RefNannyDeclarations
14384  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14385  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14386 
14387  /* function exit code */
14388  __Pyx_RefNannyFinishContext();
14389  return __pyx_r;
14390 }
14391 
14392 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
14393  PyObject *__pyx_r = NULL;
14394  __Pyx_TraceDeclarations
14395  __Pyx_RefNannyDeclarations
14396  PyObject *__pyx_t_1 = NULL;
14397  int __pyx_lineno = 0;
14398  const char *__pyx_filename = NULL;
14399  int __pyx_clineno = 0;
14400  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
14401  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
14402 
14403  /* "(tree fragment)":4
14404  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14405  * def __setstate_cython__(self, __pyx_state):
14406  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14407  */
14408  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
14409  __Pyx_GOTREF(__pyx_t_1);
14410  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14411  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14412  __PYX_ERR(1, 4, __pyx_L1_error)
14413 
14414  /* "(tree fragment)":3
14415  * def __reduce_cython__(self):
14416  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14417  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14418  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14419  */
14420 
14421  /* function exit code */
14422  __pyx_L1_error:;
14423  __Pyx_XDECREF(__pyx_t_1);
14424  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14425  __pyx_r = NULL;
14426  __Pyx_XGIVEREF(__pyx_r);
14427  __Pyx_TraceReturn(__pyx_r, 0);
14428  __Pyx_RefNannyFinishContext();
14429  return __pyx_r;
14430 }
14431 
14432 /* "View.MemoryView":657
14433  *
14434  * @cname('__pyx_memoryview_new')
14435  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14436  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14437  * result.typeinfo = typeinfo
14438  */
14439 
14440 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14441  struct __pyx_memoryview_obj *__pyx_v_result = 0;
14442  PyObject *__pyx_r = NULL;
14443  __Pyx_TraceDeclarations
14444  __Pyx_RefNannyDeclarations
14445  PyObject *__pyx_t_1 = NULL;
14446  PyObject *__pyx_t_2 = NULL;
14447  PyObject *__pyx_t_3 = NULL;
14448  int __pyx_lineno = 0;
14449  const char *__pyx_filename = NULL;
14450  int __pyx_clineno = 0;
14451  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
14452  __Pyx_TraceCall("memoryview_cwrapper", __pyx_f[1], 657, 0, __PYX_ERR(1, 657, __pyx_L1_error));
14453 
14454  /* "View.MemoryView":658
14455  * @cname('__pyx_memoryview_new')
14456  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14457  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
14458  * result.typeinfo = typeinfo
14459  * return result
14460  */
14461  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
14462  __Pyx_GOTREF(__pyx_t_1);
14463  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
14464  __Pyx_GOTREF(__pyx_t_2);
14465  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
14466  __Pyx_GOTREF(__pyx_t_3);
14467  __Pyx_INCREF(__pyx_v_o);
14468  __Pyx_GIVEREF(__pyx_v_o);
14469  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14470  __Pyx_GIVEREF(__pyx_t_1);
14471  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14472  __Pyx_GIVEREF(__pyx_t_2);
14473  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14474  __pyx_t_1 = 0;
14475  __pyx_t_2 = 0;
14476  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
14477  __Pyx_GOTREF(__pyx_t_2);
14478  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14479  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14480  __pyx_t_2 = 0;
14481 
14482  /* "View.MemoryView":659
14483  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14484  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14485  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
14486  * return result
14487  *
14488  */
14489  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
14490 
14491  /* "View.MemoryView":660
14492  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14493  * result.typeinfo = typeinfo
14494  * return result # <<<<<<<<<<<<<<
14495  *
14496  * @cname('__pyx_memoryview_check')
14497  */
14498  __Pyx_XDECREF(__pyx_r);
14499  __Pyx_INCREF(((PyObject *)__pyx_v_result));
14500  __pyx_r = ((PyObject *)__pyx_v_result);
14501  goto __pyx_L0;
14502 
14503  /* "View.MemoryView":657
14504  *
14505  * @cname('__pyx_memoryview_new')
14506  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14507  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14508  * result.typeinfo = typeinfo
14509  */
14510 
14511  /* function exit code */
14512  __pyx_L1_error:;
14513  __Pyx_XDECREF(__pyx_t_1);
14514  __Pyx_XDECREF(__pyx_t_2);
14515  __Pyx_XDECREF(__pyx_t_3);
14516  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
14517  __pyx_r = 0;
14518  __pyx_L0:;
14519  __Pyx_XDECREF((PyObject *)__pyx_v_result);
14520  __Pyx_XGIVEREF(__pyx_r);
14521  __Pyx_TraceReturn(__pyx_r, 0);
14522  __Pyx_RefNannyFinishContext();
14523  return __pyx_r;
14524 }
14525 
14526 /* "View.MemoryView":663
14527  *
14528  * @cname('__pyx_memoryview_check')
14529  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14530  * return isinstance(o, memoryview)
14531  *
14532  */
14533 
14534 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
14535  int __pyx_r;
14536  __Pyx_TraceDeclarations
14537  __Pyx_RefNannyDeclarations
14538  int __pyx_t_1;
14539  int __pyx_lineno = 0;
14540  const char *__pyx_filename = NULL;
14541  int __pyx_clineno = 0;
14542  __Pyx_RefNannySetupContext("memoryview_check", 0);
14543  __Pyx_TraceCall("memoryview_check", __pyx_f[1], 663, 0, __PYX_ERR(1, 663, __pyx_L1_error));
14544 
14545  /* "View.MemoryView":664
14546  * @cname('__pyx_memoryview_check')
14547  * cdef inline bint memoryview_check(object o):
14548  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
14549  *
14550  * cdef tuple _unellipsify(object index, int ndim):
14551  */
14552  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
14553  __pyx_r = __pyx_t_1;
14554  goto __pyx_L0;
14555 
14556  /* "View.MemoryView":663
14557  *
14558  * @cname('__pyx_memoryview_check')
14559  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14560  * return isinstance(o, memoryview)
14561  *
14562  */
14563 
14564  /* function exit code */
14565  __pyx_L1_error:;
14566  __Pyx_WriteUnraisable("View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
14567  __pyx_r = 0;
14568  __pyx_L0:;
14569  __Pyx_TraceReturn(Py_None, 0);
14570  __Pyx_RefNannyFinishContext();
14571  return __pyx_r;
14572 }
14573 
14574 /* "View.MemoryView":666
14575  * return isinstance(o, memoryview)
14576  *
14577  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
14578  * """
14579  * Replace all ellipses with full slices and fill incomplete indices with
14580  */
14581 
14582 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
14583  PyObject *__pyx_v_tup = NULL;
14584  PyObject *__pyx_v_result = NULL;
14585  int __pyx_v_have_slices;
14586  int __pyx_v_seen_ellipsis;
14587  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
14588  PyObject *__pyx_v_item = NULL;
14589  Py_ssize_t __pyx_v_nslices;
14590  PyObject *__pyx_r = NULL;
14591  __Pyx_TraceDeclarations
14592  __Pyx_RefNannyDeclarations
14593  int __pyx_t_1;
14594  int __pyx_t_2;
14595  PyObject *__pyx_t_3 = NULL;
14596  PyObject *__pyx_t_4 = NULL;
14597  Py_ssize_t __pyx_t_5;
14598  PyObject *(*__pyx_t_6)(PyObject *);
14599  PyObject *__pyx_t_7 = NULL;
14600  Py_ssize_t __pyx_t_8;
14601  int __pyx_t_9;
14602  int __pyx_t_10;
14603  PyObject *__pyx_t_11 = NULL;
14604  int __pyx_lineno = 0;
14605  const char *__pyx_filename = NULL;
14606  int __pyx_clineno = 0;
14607  __Pyx_RefNannySetupContext("_unellipsify", 0);
14608  __Pyx_TraceCall("_unellipsify", __pyx_f[1], 666, 0, __PYX_ERR(1, 666, __pyx_L1_error));
14609 
14610  /* "View.MemoryView":671
14611  * full slices.
14612  * """
14613  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
14614  * tup = (index,)
14615  * else:
14616  */
14617  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
14618  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14619  if (__pyx_t_2) {
14620 
14621  /* "View.MemoryView":672
14622  * """
14623  * if not isinstance(index, tuple):
14624  * tup = (index,) # <<<<<<<<<<<<<<
14625  * else:
14626  * tup = index
14627  */
14628  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
14629  __Pyx_GOTREF(__pyx_t_3);
14630  __Pyx_INCREF(__pyx_v_index);
14631  __Pyx_GIVEREF(__pyx_v_index);
14632  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
14633  __pyx_v_tup = __pyx_t_3;
14634  __pyx_t_3 = 0;
14635 
14636  /* "View.MemoryView":671
14637  * full slices.
14638  * """
14639  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
14640  * tup = (index,)
14641  * else:
14642  */
14643  goto __pyx_L3;
14644  }
14645 
14646  /* "View.MemoryView":674
14647  * tup = (index,)
14648  * else:
14649  * tup = index # <<<<<<<<<<<<<<
14650  *
14651  * result = []
14652  */
14653  /*else*/ {
14654  __Pyx_INCREF(__pyx_v_index);
14655  __pyx_v_tup = __pyx_v_index;
14656  }
14657  __pyx_L3:;
14658 
14659  /* "View.MemoryView":676
14660  * tup = index
14661  *
14662  * result = [] # <<<<<<<<<<<<<<
14663  * have_slices = False
14664  * seen_ellipsis = False
14665  */
14666  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
14667  __Pyx_GOTREF(__pyx_t_3);
14668  __pyx_v_result = ((PyObject*)__pyx_t_3);
14669  __pyx_t_3 = 0;
14670 
14671  /* "View.MemoryView":677
14672  *
14673  * result = []
14674  * have_slices = False # <<<<<<<<<<<<<<
14675  * seen_ellipsis = False
14676  * for idx, item in enumerate(tup):
14677  */
14678  __pyx_v_have_slices = 0;
14679 
14680  /* "View.MemoryView":678
14681  * result = []
14682  * have_slices = False
14683  * seen_ellipsis = False # <<<<<<<<<<<<<<
14684  * for idx, item in enumerate(tup):
14685  * if item is Ellipsis:
14686  */
14687  __pyx_v_seen_ellipsis = 0;
14688 
14689  /* "View.MemoryView":679
14690  * have_slices = False
14691  * seen_ellipsis = False
14692  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
14693  * if item is Ellipsis:
14694  * if not seen_ellipsis:
14695  */
14696  __Pyx_INCREF(__pyx_int_0);
14697  __pyx_t_3 = __pyx_int_0;
14698  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
14699  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
14700  __pyx_t_6 = NULL;
14701  } else {
14702  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
14703  __Pyx_GOTREF(__pyx_t_4);
14704  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
14705  }
14706  for (;;) {
14707  if (likely(!__pyx_t_6)) {
14708  if (likely(PyList_CheckExact(__pyx_t_4))) {
14709  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
14710  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14711  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
14712  #else
14713  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14714  __Pyx_GOTREF(__pyx_t_7);
14715  #endif
14716  } else {
14717  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
14718  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14719  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
14720  #else
14721  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14722  __Pyx_GOTREF(__pyx_t_7);
14723  #endif
14724  }
14725  } else {
14726  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
14727  if (unlikely(!__pyx_t_7)) {
14728  PyObject* exc_type = PyErr_Occurred();
14729  if (exc_type) {
14730  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14731  else __PYX_ERR(1, 679, __pyx_L1_error)
14732  }
14733  break;
14734  }
14735  __Pyx_GOTREF(__pyx_t_7);
14736  }
14737  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
14738  __pyx_t_7 = 0;
14739  __Pyx_INCREF(__pyx_t_3);
14740  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
14741  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14742  __Pyx_GOTREF(__pyx_t_7);
14743  __Pyx_DECREF(__pyx_t_3);
14744  __pyx_t_3 = __pyx_t_7;
14745  __pyx_t_7 = 0;
14746 
14747  /* "View.MemoryView":680
14748  * seen_ellipsis = False
14749  * for idx, item in enumerate(tup):
14750  * if item is Ellipsis: # <<<<<<<<<<<<<<
14751  * if not seen_ellipsis:
14752  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14753  */
14754  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
14755  __pyx_t_1 = (__pyx_t_2 != 0);
14756  if (__pyx_t_1) {
14757 
14758  /* "View.MemoryView":681
14759  * for idx, item in enumerate(tup):
14760  * if item is Ellipsis:
14761  * if not seen_ellipsis: # <<<<<<<<<<<<<<
14762  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14763  * seen_ellipsis = True
14764  */
14765  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
14766  if (__pyx_t_1) {
14767 
14768  /* "View.MemoryView":682
14769  * if item is Ellipsis:
14770  * if not seen_ellipsis:
14771  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
14772  * seen_ellipsis = True
14773  * else:
14774  */
14775  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
14776  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error)
14777  __Pyx_GOTREF(__pyx_t_7);
14778  { Py_ssize_t __pyx_temp;
14779  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
14780  __Pyx_INCREF(__pyx_slice__7);
14781  __Pyx_GIVEREF(__pyx_slice__7);
14782  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__7);
14783  }
14784  }
14785  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
14786  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14787 
14788  /* "View.MemoryView":683
14789  * if not seen_ellipsis:
14790  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14791  * seen_ellipsis = True # <<<<<<<<<<<<<<
14792  * else:
14793  * result.append(slice(None))
14794  */
14795  __pyx_v_seen_ellipsis = 1;
14796 
14797  /* "View.MemoryView":681
14798  * for idx, item in enumerate(tup):
14799  * if item is Ellipsis:
14800  * if not seen_ellipsis: # <<<<<<<<<<<<<<
14801  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14802  * seen_ellipsis = True
14803  */
14804  goto __pyx_L7;
14805  }
14806 
14807  /* "View.MemoryView":685
14808  * seen_ellipsis = True
14809  * else:
14810  * result.append(slice(None)) # <<<<<<<<<<<<<<
14811  * have_slices = True
14812  * else:
14813  */
14814  /*else*/ {
14815  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
14816  }
14817  __pyx_L7:;
14818 
14819  /* "View.MemoryView":686
14820  * else:
14821  * result.append(slice(None))
14822  * have_slices = True # <<<<<<<<<<<<<<
14823  * else:
14824  * if not isinstance(item, slice) and not PyIndex_Check(item):
14825  */
14826  __pyx_v_have_slices = 1;
14827 
14828  /* "View.MemoryView":680
14829  * seen_ellipsis = False
14830  * for idx, item in enumerate(tup):
14831  * if item is Ellipsis: # <<<<<<<<<<<<<<
14832  * if not seen_ellipsis:
14833  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14834  */
14835  goto __pyx_L6;
14836  }
14837 
14838  /* "View.MemoryView":688
14839  * have_slices = True
14840  * else:
14841  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
14842  * raise TypeError("Cannot index with type '%s'" % type(item))
14843  *
14844  */
14845  /*else*/ {
14846  __pyx_t_2 = PySlice_Check(__pyx_v_item);
14847  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
14848  if (__pyx_t_10) {
14849  } else {
14850  __pyx_t_1 = __pyx_t_10;
14851  goto __pyx_L9_bool_binop_done;
14852  }
14853  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
14854  __pyx_t_1 = __pyx_t_10;
14855  __pyx_L9_bool_binop_done:;
14856  if (unlikely(__pyx_t_1)) {
14857 
14858  /* "View.MemoryView":689
14859  * else:
14860  * if not isinstance(item, slice) and not PyIndex_Check(item):
14861  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
14862  *
14863  * have_slices = have_slices or isinstance(item, slice)
14864  */
14865  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error)
14866  __Pyx_GOTREF(__pyx_t_7);
14867  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
14868  __Pyx_GOTREF(__pyx_t_11);
14869  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14870  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
14871  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14872  __PYX_ERR(1, 689, __pyx_L1_error)
14873 
14874  /* "View.MemoryView":688
14875  * have_slices = True
14876  * else:
14877  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
14878  * raise TypeError("Cannot index with type '%s'" % type(item))
14879  *
14880  */
14881  }
14882 
14883  /* "View.MemoryView":691
14884  * raise TypeError("Cannot index with type '%s'" % type(item))
14885  *
14886  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
14887  * result.append(item)
14888  *
14889  */
14890  __pyx_t_10 = (__pyx_v_have_slices != 0);
14891  if (!__pyx_t_10) {
14892  } else {
14893  __pyx_t_1 = __pyx_t_10;
14894  goto __pyx_L11_bool_binop_done;
14895  }
14896  __pyx_t_10 = PySlice_Check(__pyx_v_item);
14897  __pyx_t_2 = (__pyx_t_10 != 0);
14898  __pyx_t_1 = __pyx_t_2;
14899  __pyx_L11_bool_binop_done:;
14900  __pyx_v_have_slices = __pyx_t_1;
14901 
14902  /* "View.MemoryView":692
14903  *
14904  * have_slices = have_slices or isinstance(item, slice)
14905  * result.append(item) # <<<<<<<<<<<<<<
14906  *
14907  * nslices = ndim - len(result)
14908  */
14909  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
14910  }
14911  __pyx_L6:;
14912 
14913  /* "View.MemoryView":679
14914  * have_slices = False
14915  * seen_ellipsis = False
14916  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
14917  * if item is Ellipsis:
14918  * if not seen_ellipsis:
14919  */
14920  }
14921  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14922  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14923 
14924  /* "View.MemoryView":694
14925  * result.append(item)
14926  *
14927  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
14928  * if nslices:
14929  * result.extend([slice(None)] * nslices)
14930  */
14931  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
14932  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
14933 
14934  /* "View.MemoryView":695
14935  *
14936  * nslices = ndim - len(result)
14937  * if nslices: # <<<<<<<<<<<<<<
14938  * result.extend([slice(None)] * nslices)
14939  *
14940  */
14941  __pyx_t_1 = (__pyx_v_nslices != 0);
14942  if (__pyx_t_1) {
14943 
14944  /* "View.MemoryView":696
14945  * nslices = ndim - len(result)
14946  * if nslices:
14947  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
14948  *
14949  * return have_slices or nslices, tuple(result)
14950  */
14951  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
14952  __Pyx_GOTREF(__pyx_t_3);
14953  { Py_ssize_t __pyx_temp;
14954  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
14955  __Pyx_INCREF(__pyx_slice__7);
14956  __Pyx_GIVEREF(__pyx_slice__7);
14957  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__7);
14958  }
14959  }
14960  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
14961  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14962 
14963  /* "View.MemoryView":695
14964  *
14965  * nslices = ndim - len(result)
14966  * if nslices: # <<<<<<<<<<<<<<
14967  * result.extend([slice(None)] * nslices)
14968  *
14969  */
14970  }
14971 
14972  /* "View.MemoryView":698
14973  * result.extend([slice(None)] * nslices)
14974  *
14975  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
14976  *
14977  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14978  */
14979  __Pyx_XDECREF(__pyx_r);
14980  if (!__pyx_v_have_slices) {
14981  } else {
14982  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
14983  __Pyx_GOTREF(__pyx_t_4);
14984  __pyx_t_3 = __pyx_t_4;
14985  __pyx_t_4 = 0;
14986  goto __pyx_L14_bool_binop_done;
14987  }
14988  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
14989  __Pyx_GOTREF(__pyx_t_4);
14990  __pyx_t_3 = __pyx_t_4;
14991  __pyx_t_4 = 0;
14992  __pyx_L14_bool_binop_done:;
14993  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
14994  __Pyx_GOTREF(__pyx_t_4);
14995  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
14996  __Pyx_GOTREF(__pyx_t_11);
14997  __Pyx_GIVEREF(__pyx_t_3);
14998  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
14999  __Pyx_GIVEREF(__pyx_t_4);
15000  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
15001  __pyx_t_3 = 0;
15002  __pyx_t_4 = 0;
15003  __pyx_r = ((PyObject*)__pyx_t_11);
15004  __pyx_t_11 = 0;
15005  goto __pyx_L0;
15006 
15007  /* "View.MemoryView":666
15008  * return isinstance(o, memoryview)
15009  *
15010  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
15011  * """
15012  * Replace all ellipses with full slices and fill incomplete indices with
15013  */
15014 
15015  /* function exit code */
15016  __pyx_L1_error:;
15017  __Pyx_XDECREF(__pyx_t_3);
15018  __Pyx_XDECREF(__pyx_t_4);
15019  __Pyx_XDECREF(__pyx_t_7);
15020  __Pyx_XDECREF(__pyx_t_11);
15021  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
15022  __pyx_r = 0;
15023  __pyx_L0:;
15024  __Pyx_XDECREF(__pyx_v_tup);
15025  __Pyx_XDECREF(__pyx_v_result);
15026  __Pyx_XDECREF(__pyx_v_idx);
15027  __Pyx_XDECREF(__pyx_v_item);
15028  __Pyx_XGIVEREF(__pyx_r);
15029  __Pyx_TraceReturn(__pyx_r, 0);
15030  __Pyx_RefNannyFinishContext();
15031  return __pyx_r;
15032 }
15033 
15034 /* "View.MemoryView":700
15035  * return have_slices or nslices, tuple(result)
15036  *
15037  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15038  * for suboffset in suboffsets[:ndim]:
15039  * if suboffset >= 0:
15040  */
15041 
15042 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
15043  Py_ssize_t __pyx_v_suboffset;
15044  PyObject *__pyx_r = NULL;
15045  __Pyx_TraceDeclarations
15046  __Pyx_RefNannyDeclarations
15047  Py_ssize_t *__pyx_t_1;
15048  Py_ssize_t *__pyx_t_2;
15049  Py_ssize_t *__pyx_t_3;
15050  int __pyx_t_4;
15051  PyObject *__pyx_t_5 = NULL;
15052  int __pyx_lineno = 0;
15053  const char *__pyx_filename = NULL;
15054  int __pyx_clineno = 0;
15055  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
15056  __Pyx_TraceCall("assert_direct_dimensions", __pyx_f[1], 700, 0, __PYX_ERR(1, 700, __pyx_L1_error));
15057 
15058  /* "View.MemoryView":701
15059  *
15060  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15061  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
15062  * if suboffset >= 0:
15063  * raise ValueError("Indirect dimensions not supported")
15064  */
15065  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
15066  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
15067  __pyx_t_1 = __pyx_t_3;
15068  __pyx_v_suboffset = (__pyx_t_1[0]);
15069 
15070  /* "View.MemoryView":702
15071  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15072  * for suboffset in suboffsets[:ndim]:
15073  * if suboffset >= 0: # <<<<<<<<<<<<<<
15074  * raise ValueError("Indirect dimensions not supported")
15075  *
15076  */
15077  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
15078  if (unlikely(__pyx_t_4)) {
15079 
15080  /* "View.MemoryView":703
15081  * for suboffset in suboffsets[:ndim]:
15082  * if suboffset >= 0:
15083  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
15084  *
15085  *
15086  */
15087  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
15088  __Pyx_GOTREF(__pyx_t_5);
15089  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
15090  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15091  __PYX_ERR(1, 703, __pyx_L1_error)
15092 
15093  /* "View.MemoryView":702
15094  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15095  * for suboffset in suboffsets[:ndim]:
15096  * if suboffset >= 0: # <<<<<<<<<<<<<<
15097  * raise ValueError("Indirect dimensions not supported")
15098  *
15099  */
15100  }
15101  }
15102 
15103  /* "View.MemoryView":700
15104  * return have_slices or nslices, tuple(result)
15105  *
15106  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15107  * for suboffset in suboffsets[:ndim]:
15108  * if suboffset >= 0:
15109  */
15110 
15111  /* function exit code */
15112  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15113  goto __pyx_L0;
15114  __pyx_L1_error:;
15115  __Pyx_XDECREF(__pyx_t_5);
15116  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
15117  __pyx_r = 0;
15118  __pyx_L0:;
15119  __Pyx_XGIVEREF(__pyx_r);
15120  __Pyx_TraceReturn(__pyx_r, 0);
15121  __Pyx_RefNannyFinishContext();
15122  return __pyx_r;
15123 }
15124 
15125 /* "View.MemoryView":710
15126  *
15127  * @cname('__pyx_memview_slice')
15128  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
15129  * cdef int new_ndim = 0, suboffset_dim = -1, dim
15130  * cdef bint negative_step
15131  */
15132 
15133 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
15134  int __pyx_v_new_ndim;
15135  int __pyx_v_suboffset_dim;
15136  int __pyx_v_dim;
15137  __Pyx_memviewslice __pyx_v_src;
15138  __Pyx_memviewslice __pyx_v_dst;
15139  __Pyx_memviewslice *__pyx_v_p_src;
15140  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
15141  __Pyx_memviewslice *__pyx_v_p_dst;
15142  int *__pyx_v_p_suboffset_dim;
15143  Py_ssize_t __pyx_v_start;
15144  Py_ssize_t __pyx_v_stop;
15145  Py_ssize_t __pyx_v_step;
15146  int __pyx_v_have_start;
15147  int __pyx_v_have_stop;
15148  int __pyx_v_have_step;
15149  PyObject *__pyx_v_index = NULL;
15150  struct __pyx_memoryview_obj *__pyx_r = NULL;
15151  __Pyx_TraceDeclarations
15152  __Pyx_RefNannyDeclarations
15153  int __pyx_t_1;
15154  int __pyx_t_2;
15155  PyObject *__pyx_t_3 = NULL;
15156  struct __pyx_memoryview_obj *__pyx_t_4;
15157  char *__pyx_t_5;
15158  int __pyx_t_6;
15159  Py_ssize_t __pyx_t_7;
15160  PyObject *(*__pyx_t_8)(PyObject *);
15161  PyObject *__pyx_t_9 = NULL;
15162  Py_ssize_t __pyx_t_10;
15163  int __pyx_t_11;
15164  Py_ssize_t __pyx_t_12;
15165  int __pyx_lineno = 0;
15166  const char *__pyx_filename = NULL;
15167  int __pyx_clineno = 0;
15168  __Pyx_RefNannySetupContext("memview_slice", 0);
15169  __Pyx_TraceCall("memview_slice", __pyx_f[1], 710, 0, __PYX_ERR(1, 710, __pyx_L1_error));
15170 
15171  /* "View.MemoryView":711
15172  * @cname('__pyx_memview_slice')
15173  * cdef memoryview memview_slice(memoryview memview, object indices):
15174  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
15175  * cdef bint negative_step
15176  * cdef __Pyx_memviewslice src, dst
15177  */
15178  __pyx_v_new_ndim = 0;
15179  __pyx_v_suboffset_dim = -1;
15180 
15181  /* "View.MemoryView":718
15182  *
15183  *
15184  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
15185  *
15186  * cdef _memoryviewslice memviewsliceobj
15187  */
15188  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
15189 
15190  /* "View.MemoryView":722
15191  * cdef _memoryviewslice memviewsliceobj
15192  *
15193  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
15194  *
15195  * if isinstance(memview, _memoryviewslice):
15196  */
15197  #ifndef CYTHON_WITHOUT_ASSERTIONS
15198  if (unlikely(!Py_OptimizeFlag)) {
15199  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
15200  PyErr_SetNone(PyExc_AssertionError);
15201  __PYX_ERR(1, 722, __pyx_L1_error)
15202  }
15203  }
15204  #endif
15205 
15206  /* "View.MemoryView":724
15207  * assert memview.view.ndim > 0
15208  *
15209  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15210  * memviewsliceobj = memview
15211  * p_src = &memviewsliceobj.from_slice
15212  */
15213  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15214  __pyx_t_2 = (__pyx_t_1 != 0);
15215  if (__pyx_t_2) {
15216 
15217  /* "View.MemoryView":725
15218  *
15219  * if isinstance(memview, _memoryviewslice):
15220  * memviewsliceobj = memview # <<<<<<<<<<<<<<
15221  * p_src = &memviewsliceobj.from_slice
15222  * else:
15223  */
15224  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
15225  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15226  __Pyx_INCREF(__pyx_t_3);
15227  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15228  __pyx_t_3 = 0;
15229 
15230  /* "View.MemoryView":726
15231  * if isinstance(memview, _memoryviewslice):
15232  * memviewsliceobj = memview
15233  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
15234  * else:
15235  * slice_copy(memview, &src)
15236  */
15237  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
15238 
15239  /* "View.MemoryView":724
15240  * assert memview.view.ndim > 0
15241  *
15242  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15243  * memviewsliceobj = memview
15244  * p_src = &memviewsliceobj.from_slice
15245  */
15246  goto __pyx_L3;
15247  }
15248 
15249  /* "View.MemoryView":728
15250  * p_src = &memviewsliceobj.from_slice
15251  * else:
15252  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
15253  * p_src = &src
15254  *
15255  */
15256  /*else*/ {
15257  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15258 
15259  /* "View.MemoryView":729
15260  * else:
15261  * slice_copy(memview, &src)
15262  * p_src = &src # <<<<<<<<<<<<<<
15263  *
15264  *
15265  */
15266  __pyx_v_p_src = (&__pyx_v_src);
15267  }
15268  __pyx_L3:;
15269 
15270  /* "View.MemoryView":735
15271  *
15272  *
15273  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
15274  * dst.data = p_src.data
15275  *
15276  */
15277  __pyx_t_4 = __pyx_v_p_src->memview;
15278  __pyx_v_dst.memview = __pyx_t_4;
15279 
15280  /* "View.MemoryView":736
15281  *
15282  * dst.memview = p_src.memview
15283  * dst.data = p_src.data # <<<<<<<<<<<<<<
15284  *
15285  *
15286  */
15287  __pyx_t_5 = __pyx_v_p_src->data;
15288  __pyx_v_dst.data = __pyx_t_5;
15289 
15290  /* "View.MemoryView":741
15291  *
15292  *
15293  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
15294  * cdef int *p_suboffset_dim = &suboffset_dim
15295  * cdef Py_ssize_t start, stop, step
15296  */
15297  __pyx_v_p_dst = (&__pyx_v_dst);
15298 
15299  /* "View.MemoryView":742
15300  *
15301  * cdef __Pyx_memviewslice *p_dst = &dst
15302  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
15303  * cdef Py_ssize_t start, stop, step
15304  * cdef bint have_start, have_stop, have_step
15305  */
15306  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
15307 
15308  /* "View.MemoryView":746
15309  * cdef bint have_start, have_stop, have_step
15310  *
15311  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15312  * if PyIndex_Check(index):
15313  * slice_memviewslice(
15314  */
15315  __pyx_t_6 = 0;
15316  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
15317  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
15318  __pyx_t_8 = NULL;
15319  } else {
15320  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
15321  __Pyx_GOTREF(__pyx_t_3);
15322  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
15323  }
15324  for (;;) {
15325  if (likely(!__pyx_t_8)) {
15326  if (likely(PyList_CheckExact(__pyx_t_3))) {
15327  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
15328  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15329  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
15330  #else
15331  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
15332  __Pyx_GOTREF(__pyx_t_9);
15333  #endif
15334  } else {
15335  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
15336  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15337  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
15338  #else
15339  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
15340  __Pyx_GOTREF(__pyx_t_9);
15341  #endif
15342  }
15343  } else {
15344  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15345  if (unlikely(!__pyx_t_9)) {
15346  PyObject* exc_type = PyErr_Occurred();
15347  if (exc_type) {
15348  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15349  else __PYX_ERR(1, 746, __pyx_L1_error)
15350  }
15351  break;
15352  }
15353  __Pyx_GOTREF(__pyx_t_9);
15354  }
15355  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15356  __pyx_t_9 = 0;
15357  __pyx_v_dim = __pyx_t_6;
15358  __pyx_t_6 = (__pyx_t_6 + 1);
15359 
15360  /* "View.MemoryView":747
15361  *
15362  * for dim, index in enumerate(indices):
15363  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15364  * slice_memviewslice(
15365  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15366  */
15367  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15368  if (__pyx_t_2) {
15369 
15370  /* "View.MemoryView":751
15371  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15372  * dim, new_ndim, p_suboffset_dim,
15373  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
15374  * 0, 0, 0, # have_{start,stop,step}
15375  * False)
15376  */
15377  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
15378 
15379  /* "View.MemoryView":748
15380  * for dim, index in enumerate(indices):
15381  * if PyIndex_Check(index):
15382  * slice_memviewslice( # <<<<<<<<<<<<<<
15383  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15384  * dim, new_ndim, p_suboffset_dim,
15385  */
15386  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 748, __pyx_L1_error)
15387 
15388  /* "View.MemoryView":747
15389  *
15390  * for dim, index in enumerate(indices):
15391  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15392  * slice_memviewslice(
15393  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15394  */
15395  goto __pyx_L6;
15396  }
15397 
15398  /* "View.MemoryView":754
15399  * 0, 0, 0, # have_{start,stop,step}
15400  * False)
15401  * elif index is None: # <<<<<<<<<<<<<<
15402  * p_dst.shape[new_ndim] = 1
15403  * p_dst.strides[new_ndim] = 0
15404  */
15405  __pyx_t_2 = (__pyx_v_index == Py_None);
15406  __pyx_t_1 = (__pyx_t_2 != 0);
15407  if (__pyx_t_1) {
15408 
15409  /* "View.MemoryView":755
15410  * False)
15411  * elif index is None:
15412  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
15413  * p_dst.strides[new_ndim] = 0
15414  * p_dst.suboffsets[new_ndim] = -1
15415  */
15416  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15417 
15418  /* "View.MemoryView":756
15419  * elif index is None:
15420  * p_dst.shape[new_ndim] = 1
15421  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
15422  * p_dst.suboffsets[new_ndim] = -1
15423  * new_ndim += 1
15424  */
15425  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15426 
15427  /* "View.MemoryView":757
15428  * p_dst.shape[new_ndim] = 1
15429  * p_dst.strides[new_ndim] = 0
15430  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
15431  * new_ndim += 1
15432  * else:
15433  */
15434  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
15435 
15436  /* "View.MemoryView":758
15437  * p_dst.strides[new_ndim] = 0
15438  * p_dst.suboffsets[new_ndim] = -1
15439  * new_ndim += 1 # <<<<<<<<<<<<<<
15440  * else:
15441  * start = index.start or 0
15442  */
15443  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15444 
15445  /* "View.MemoryView":754
15446  * 0, 0, 0, # have_{start,stop,step}
15447  * False)
15448  * elif index is None: # <<<<<<<<<<<<<<
15449  * p_dst.shape[new_ndim] = 1
15450  * p_dst.strides[new_ndim] = 0
15451  */
15452  goto __pyx_L6;
15453  }
15454 
15455  /* "View.MemoryView":760
15456  * new_ndim += 1
15457  * else:
15458  * start = index.start or 0 # <<<<<<<<<<<<<<
15459  * stop = index.stop or 0
15460  * step = index.step or 0
15461  */
15462  /*else*/ {
15463  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
15464  __Pyx_GOTREF(__pyx_t_9);
15465  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
15466  if (!__pyx_t_1) {
15467  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15468  } else {
15469  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
15470  __pyx_t_10 = __pyx_t_12;
15471  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15472  goto __pyx_L7_bool_binop_done;
15473  }
15474  __pyx_t_10 = 0;
15475  __pyx_L7_bool_binop_done:;
15476  __pyx_v_start = __pyx_t_10;
15477 
15478  /* "View.MemoryView":761
15479  * else:
15480  * start = index.start or 0
15481  * stop = index.stop or 0 # <<<<<<<<<<<<<<
15482  * step = index.step or 0
15483  *
15484  */
15485  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
15486  __Pyx_GOTREF(__pyx_t_9);
15487  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
15488  if (!__pyx_t_1) {
15489  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15490  } else {
15491  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
15492  __pyx_t_10 = __pyx_t_12;
15493  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15494  goto __pyx_L9_bool_binop_done;
15495  }
15496  __pyx_t_10 = 0;
15497  __pyx_L9_bool_binop_done:;
15498  __pyx_v_stop = __pyx_t_10;
15499 
15500  /* "View.MemoryView":762
15501  * start = index.start or 0
15502  * stop = index.stop or 0
15503  * step = index.step or 0 # <<<<<<<<<<<<<<
15504  *
15505  * have_start = index.start is not None
15506  */
15507  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
15508  __Pyx_GOTREF(__pyx_t_9);
15509  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
15510  if (!__pyx_t_1) {
15511  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15512  } else {
15513  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
15514  __pyx_t_10 = __pyx_t_12;
15515  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15516  goto __pyx_L11_bool_binop_done;
15517  }
15518  __pyx_t_10 = 0;
15519  __pyx_L11_bool_binop_done:;
15520  __pyx_v_step = __pyx_t_10;
15521 
15522  /* "View.MemoryView":764
15523  * step = index.step or 0
15524  *
15525  * have_start = index.start is not None # <<<<<<<<<<<<<<
15526  * have_stop = index.stop is not None
15527  * have_step = index.step is not None
15528  */
15529  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
15530  __Pyx_GOTREF(__pyx_t_9);
15531  __pyx_t_1 = (__pyx_t_9 != Py_None);
15532  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15533  __pyx_v_have_start = __pyx_t_1;
15534 
15535  /* "View.MemoryView":765
15536  *
15537  * have_start = index.start is not None
15538  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
15539  * have_step = index.step is not None
15540  *
15541  */
15542  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
15543  __Pyx_GOTREF(__pyx_t_9);
15544  __pyx_t_1 = (__pyx_t_9 != Py_None);
15545  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15546  __pyx_v_have_stop = __pyx_t_1;
15547 
15548  /* "View.MemoryView":766
15549  * have_start = index.start is not None
15550  * have_stop = index.stop is not None
15551  * have_step = index.step is not None # <<<<<<<<<<<<<<
15552  *
15553  * slice_memviewslice(
15554  */
15555  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
15556  __Pyx_GOTREF(__pyx_t_9);
15557  __pyx_t_1 = (__pyx_t_9 != Py_None);
15558  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15559  __pyx_v_have_step = __pyx_t_1;
15560 
15561  /* "View.MemoryView":768
15562  * have_step = index.step is not None
15563  *
15564  * slice_memviewslice( # <<<<<<<<<<<<<<
15565  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15566  * dim, new_ndim, p_suboffset_dim,
15567  */
15568  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 768, __pyx_L1_error)
15569 
15570  /* "View.MemoryView":774
15571  * have_start, have_stop, have_step,
15572  * True)
15573  * new_ndim += 1 # <<<<<<<<<<<<<<
15574  *
15575  * if isinstance(memview, _memoryviewslice):
15576  */
15577  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15578  }
15579  __pyx_L6:;
15580 
15581  /* "View.MemoryView":746
15582  * cdef bint have_start, have_stop, have_step
15583  *
15584  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15585  * if PyIndex_Check(index):
15586  * slice_memviewslice(
15587  */
15588  }
15589  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15590 
15591  /* "View.MemoryView":776
15592  * new_ndim += 1
15593  *
15594  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15595  * return memoryview_fromslice(dst, new_ndim,
15596  * memviewsliceobj.to_object_func,
15597  */
15598  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15599  __pyx_t_2 = (__pyx_t_1 != 0);
15600  if (__pyx_t_2) {
15601 
15602  /* "View.MemoryView":777
15603  *
15604  * if isinstance(memview, _memoryviewslice):
15605  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15606  * memviewsliceobj.to_object_func,
15607  * memviewsliceobj.to_dtype_func,
15608  */
15609  __Pyx_XDECREF(((PyObject *)__pyx_r));
15610 
15611  /* "View.MemoryView":778
15612  * if isinstance(memview, _memoryviewslice):
15613  * return memoryview_fromslice(dst, new_ndim,
15614  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
15615  * memviewsliceobj.to_dtype_func,
15616  * memview.dtype_is_object)
15617  */
15618  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
15619 
15620  /* "View.MemoryView":779
15621  * return memoryview_fromslice(dst, new_ndim,
15622  * memviewsliceobj.to_object_func,
15623  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
15624  * memview.dtype_is_object)
15625  * else:
15626  */
15627  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
15628 
15629  /* "View.MemoryView":777
15630  *
15631  * if isinstance(memview, _memoryviewslice):
15632  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15633  * memviewsliceobj.to_object_func,
15634  * memviewsliceobj.to_dtype_func,
15635  */
15636  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
15637  __Pyx_GOTREF(__pyx_t_3);
15638  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
15639  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15640  __pyx_t_3 = 0;
15641  goto __pyx_L0;
15642 
15643  /* "View.MemoryView":776
15644  * new_ndim += 1
15645  *
15646  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15647  * return memoryview_fromslice(dst, new_ndim,
15648  * memviewsliceobj.to_object_func,
15649  */
15650  }
15651 
15652  /* "View.MemoryView":782
15653  * memview.dtype_is_object)
15654  * else:
15655  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
15656  * memview.dtype_is_object)
15657  *
15658  */
15659  /*else*/ {
15660  __Pyx_XDECREF(((PyObject *)__pyx_r));
15661 
15662  /* "View.MemoryView":783
15663  * else:
15664  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
15665  * memview.dtype_is_object) # <<<<<<<<<<<<<<
15666  *
15667  *
15668  */
15669  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error)
15670  __Pyx_GOTREF(__pyx_t_3);
15671 
15672  /* "View.MemoryView":782
15673  * memview.dtype_is_object)
15674  * else:
15675  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
15676  * memview.dtype_is_object)
15677  *
15678  */
15679  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
15680  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15681  __pyx_t_3 = 0;
15682  goto __pyx_L0;
15683  }
15684 
15685  /* "View.MemoryView":710
15686  *
15687  * @cname('__pyx_memview_slice')
15688  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
15689  * cdef int new_ndim = 0, suboffset_dim = -1, dim
15690  * cdef bint negative_step
15691  */
15692 
15693  /* function exit code */
15694  __pyx_L1_error:;
15695  __Pyx_XDECREF(__pyx_t_3);
15696  __Pyx_XDECREF(__pyx_t_9);
15697  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15698  __pyx_r = 0;
15699  __pyx_L0:;
15700  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
15701  __Pyx_XDECREF(__pyx_v_index);
15702  __Pyx_XGIVEREF((PyObject *)__pyx_r);
15703  __Pyx_TraceReturn(__pyx_r, 0);
15704  __Pyx_RefNannyFinishContext();
15705  return __pyx_r;
15706 }
15707 
15708 /* "View.MemoryView":807
15709  *
15710  * @cname('__pyx_memoryview_slice_memviewslice')
15711  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
15712  * __Pyx_memviewslice *dst,
15713  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
15714  */
15715 
15716 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
15717  Py_ssize_t __pyx_v_new_shape;
15718  int __pyx_v_negative_step;
15719  int __pyx_r;
15720  __Pyx_TraceDeclarations
15721  int __pyx_t_1;
15722  int __pyx_t_2;
15723  int __pyx_t_3;
15724  int __pyx_lineno = 0;
15725  const char *__pyx_filename = NULL;
15726  int __pyx_clineno = 0;
15727  __Pyx_TraceCall("slice_memviewslice", __pyx_f[1], 807, 1, __PYX_ERR(1, 807, __pyx_L1_error));
15728 
15729  /* "View.MemoryView":827
15730  * cdef bint negative_step
15731  *
15732  * if not is_slice: # <<<<<<<<<<<<<<
15733  *
15734  * if start < 0:
15735  */
15736  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
15737  if (__pyx_t_1) {
15738 
15739  /* "View.MemoryView":829
15740  * if not is_slice:
15741  *
15742  * if start < 0: # <<<<<<<<<<<<<<
15743  * start += shape
15744  * if not 0 <= start < shape:
15745  */
15746  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
15747  if (__pyx_t_1) {
15748 
15749  /* "View.MemoryView":830
15750  *
15751  * if start < 0:
15752  * start += shape # <<<<<<<<<<<<<<
15753  * if not 0 <= start < shape:
15754  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15755  */
15756  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15757 
15758  /* "View.MemoryView":829
15759  * if not is_slice:
15760  *
15761  * if start < 0: # <<<<<<<<<<<<<<
15762  * start += shape
15763  * if not 0 <= start < shape:
15764  */
15765  }
15766 
15767  /* "View.MemoryView":831
15768  * if start < 0:
15769  * start += shape
15770  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
15771  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15772  * else:
15773  */
15774  __pyx_t_1 = (0 <= __pyx_v_start);
15775  if (__pyx_t_1) {
15776  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
15777  }
15778  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15779  if (__pyx_t_2) {
15780 
15781  /* "View.MemoryView":832
15782  * start += shape
15783  * if not 0 <= start < shape:
15784  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
15785  * else:
15786  *
15787  */
15788  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
15789 
15790  /* "View.MemoryView":831
15791  * if start < 0:
15792  * start += shape
15793  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
15794  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15795  * else:
15796  */
15797  }
15798 
15799  /* "View.MemoryView":827
15800  * cdef bint negative_step
15801  *
15802  * if not is_slice: # <<<<<<<<<<<<<<
15803  *
15804  * if start < 0:
15805  */
15806  goto __pyx_L3;
15807  }
15808 
15809  /* "View.MemoryView":835
15810  * else:
15811  *
15812  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
15813  *
15814  * if have_step and step == 0:
15815  */
15816  /*else*/ {
15817  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
15818  if (__pyx_t_1) {
15819  } else {
15820  __pyx_t_2 = __pyx_t_1;
15821  goto __pyx_L6_bool_binop_done;
15822  }
15823  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
15824  __pyx_t_2 = __pyx_t_1;
15825  __pyx_L6_bool_binop_done:;
15826  __pyx_v_negative_step = __pyx_t_2;
15827 
15828  /* "View.MemoryView":837
15829  * negative_step = have_step != 0 and step < 0
15830  *
15831  * if have_step and step == 0: # <<<<<<<<<<<<<<
15832  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
15833  *
15834  */
15835  __pyx_t_1 = (__pyx_v_have_step != 0);
15836  if (__pyx_t_1) {
15837  } else {
15838  __pyx_t_2 = __pyx_t_1;
15839  goto __pyx_L9_bool_binop_done;
15840  }
15841  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
15842  __pyx_t_2 = __pyx_t_1;
15843  __pyx_L9_bool_binop_done:;
15844  if (__pyx_t_2) {
15845 
15846  /* "View.MemoryView":838
15847  *
15848  * if have_step and step == 0:
15849  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
15850  *
15851  *
15852  */
15853  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
15854 
15855  /* "View.MemoryView":837
15856  * negative_step = have_step != 0 and step < 0
15857  *
15858  * if have_step and step == 0: # <<<<<<<<<<<<<<
15859  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
15860  *
15861  */
15862  }
15863 
15864  /* "View.MemoryView":841
15865  *
15866  *
15867  * if have_start: # <<<<<<<<<<<<<<
15868  * if start < 0:
15869  * start += shape
15870  */
15871  __pyx_t_2 = (__pyx_v_have_start != 0);
15872  if (__pyx_t_2) {
15873 
15874  /* "View.MemoryView":842
15875  *
15876  * if have_start:
15877  * if start < 0: # <<<<<<<<<<<<<<
15878  * start += shape
15879  * if start < 0:
15880  */
15881  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15882  if (__pyx_t_2) {
15883 
15884  /* "View.MemoryView":843
15885  * if have_start:
15886  * if start < 0:
15887  * start += shape # <<<<<<<<<<<<<<
15888  * if start < 0:
15889  * start = 0
15890  */
15891  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15892 
15893  /* "View.MemoryView":844
15894  * if start < 0:
15895  * start += shape
15896  * if start < 0: # <<<<<<<<<<<<<<
15897  * start = 0
15898  * elif start >= shape:
15899  */
15900  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15901  if (__pyx_t_2) {
15902 
15903  /* "View.MemoryView":845
15904  * start += shape
15905  * if start < 0:
15906  * start = 0 # <<<<<<<<<<<<<<
15907  * elif start >= shape:
15908  * if negative_step:
15909  */
15910  __pyx_v_start = 0;
15911 
15912  /* "View.MemoryView":844
15913  * if start < 0:
15914  * start += shape
15915  * if start < 0: # <<<<<<<<<<<<<<
15916  * start = 0
15917  * elif start >= shape:
15918  */
15919  }
15920 
15921  /* "View.MemoryView":842
15922  *
15923  * if have_start:
15924  * if start < 0: # <<<<<<<<<<<<<<
15925  * start += shape
15926  * if start < 0:
15927  */
15928  goto __pyx_L12;
15929  }
15930 
15931  /* "View.MemoryView":846
15932  * if start < 0:
15933  * start = 0
15934  * elif start >= shape: # <<<<<<<<<<<<<<
15935  * if negative_step:
15936  * start = shape - 1
15937  */
15938  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
15939  if (__pyx_t_2) {
15940 
15941  /* "View.MemoryView":847
15942  * start = 0
15943  * elif start >= shape:
15944  * if negative_step: # <<<<<<<<<<<<<<
15945  * start = shape - 1
15946  * else:
15947  */
15948  __pyx_t_2 = (__pyx_v_negative_step != 0);
15949  if (__pyx_t_2) {
15950 
15951  /* "View.MemoryView":848
15952  * elif start >= shape:
15953  * if negative_step:
15954  * start = shape - 1 # <<<<<<<<<<<<<<
15955  * else:
15956  * start = shape
15957  */
15958  __pyx_v_start = (__pyx_v_shape - 1);
15959 
15960  /* "View.MemoryView":847
15961  * start = 0
15962  * elif start >= shape:
15963  * if negative_step: # <<<<<<<<<<<<<<
15964  * start = shape - 1
15965  * else:
15966  */
15967  goto __pyx_L14;
15968  }
15969 
15970  /* "View.MemoryView":850
15971  * start = shape - 1
15972  * else:
15973  * start = shape # <<<<<<<<<<<<<<
15974  * else:
15975  * if negative_step:
15976  */
15977  /*else*/ {
15978  __pyx_v_start = __pyx_v_shape;
15979  }
15980  __pyx_L14:;
15981 
15982  /* "View.MemoryView":846
15983  * if start < 0:
15984  * start = 0
15985  * elif start >= shape: # <<<<<<<<<<<<<<
15986  * if negative_step:
15987  * start = shape - 1
15988  */
15989  }
15990  __pyx_L12:;
15991 
15992  /* "View.MemoryView":841
15993  *
15994  *
15995  * if have_start: # <<<<<<<<<<<<<<
15996  * if start < 0:
15997  * start += shape
15998  */
15999  goto __pyx_L11;
16000  }
16001 
16002  /* "View.MemoryView":852
16003  * start = shape
16004  * else:
16005  * if negative_step: # <<<<<<<<<<<<<<
16006  * start = shape - 1
16007  * else:
16008  */
16009  /*else*/ {
16010  __pyx_t_2 = (__pyx_v_negative_step != 0);
16011  if (__pyx_t_2) {
16012 
16013  /* "View.MemoryView":853
16014  * else:
16015  * if negative_step:
16016  * start = shape - 1 # <<<<<<<<<<<<<<
16017  * else:
16018  * start = 0
16019  */
16020  __pyx_v_start = (__pyx_v_shape - 1);
16021 
16022  /* "View.MemoryView":852
16023  * start = shape
16024  * else:
16025  * if negative_step: # <<<<<<<<<<<<<<
16026  * start = shape - 1
16027  * else:
16028  */
16029  goto __pyx_L15;
16030  }
16031 
16032  /* "View.MemoryView":855
16033  * start = shape - 1
16034  * else:
16035  * start = 0 # <<<<<<<<<<<<<<
16036  *
16037  * if have_stop:
16038  */
16039  /*else*/ {
16040  __pyx_v_start = 0;
16041  }
16042  __pyx_L15:;
16043  }
16044  __pyx_L11:;
16045 
16046  /* "View.MemoryView":857
16047  * start = 0
16048  *
16049  * if have_stop: # <<<<<<<<<<<<<<
16050  * if stop < 0:
16051  * stop += shape
16052  */
16053  __pyx_t_2 = (__pyx_v_have_stop != 0);
16054  if (__pyx_t_2) {
16055 
16056  /* "View.MemoryView":858
16057  *
16058  * if have_stop:
16059  * if stop < 0: # <<<<<<<<<<<<<<
16060  * stop += shape
16061  * if stop < 0:
16062  */
16063  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16064  if (__pyx_t_2) {
16065 
16066  /* "View.MemoryView":859
16067  * if have_stop:
16068  * if stop < 0:
16069  * stop += shape # <<<<<<<<<<<<<<
16070  * if stop < 0:
16071  * stop = 0
16072  */
16073  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
16074 
16075  /* "View.MemoryView":860
16076  * if stop < 0:
16077  * stop += shape
16078  * if stop < 0: # <<<<<<<<<<<<<<
16079  * stop = 0
16080  * elif stop > shape:
16081  */
16082  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16083  if (__pyx_t_2) {
16084 
16085  /* "View.MemoryView":861
16086  * stop += shape
16087  * if stop < 0:
16088  * stop = 0 # <<<<<<<<<<<<<<
16089  * elif stop > shape:
16090  * stop = shape
16091  */
16092  __pyx_v_stop = 0;
16093 
16094  /* "View.MemoryView":860
16095  * if stop < 0:
16096  * stop += shape
16097  * if stop < 0: # <<<<<<<<<<<<<<
16098  * stop = 0
16099  * elif stop > shape:
16100  */
16101  }
16102 
16103  /* "View.MemoryView":858
16104  *
16105  * if have_stop:
16106  * if stop < 0: # <<<<<<<<<<<<<<
16107  * stop += shape
16108  * if stop < 0:
16109  */
16110  goto __pyx_L17;
16111  }
16112 
16113  /* "View.MemoryView":862
16114  * if stop < 0:
16115  * stop = 0
16116  * elif stop > shape: # <<<<<<<<<<<<<<
16117  * stop = shape
16118  * else:
16119  */
16120  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
16121  if (__pyx_t_2) {
16122 
16123  /* "View.MemoryView":863
16124  * stop = 0
16125  * elif stop > shape:
16126  * stop = shape # <<<<<<<<<<<<<<
16127  * else:
16128  * if negative_step:
16129  */
16130  __pyx_v_stop = __pyx_v_shape;
16131 
16132  /* "View.MemoryView":862
16133  * if stop < 0:
16134  * stop = 0
16135  * elif stop > shape: # <<<<<<<<<<<<<<
16136  * stop = shape
16137  * else:
16138  */
16139  }
16140  __pyx_L17:;
16141 
16142  /* "View.MemoryView":857
16143  * start = 0
16144  *
16145  * if have_stop: # <<<<<<<<<<<<<<
16146  * if stop < 0:
16147  * stop += shape
16148  */
16149  goto __pyx_L16;
16150  }
16151 
16152  /* "View.MemoryView":865
16153  * stop = shape
16154  * else:
16155  * if negative_step: # <<<<<<<<<<<<<<
16156  * stop = -1
16157  * else:
16158  */
16159  /*else*/ {
16160  __pyx_t_2 = (__pyx_v_negative_step != 0);
16161  if (__pyx_t_2) {
16162 
16163  /* "View.MemoryView":866
16164  * else:
16165  * if negative_step:
16166  * stop = -1 # <<<<<<<<<<<<<<
16167  * else:
16168  * stop = shape
16169  */
16170  __pyx_v_stop = -1L;
16171 
16172  /* "View.MemoryView":865
16173  * stop = shape
16174  * else:
16175  * if negative_step: # <<<<<<<<<<<<<<
16176  * stop = -1
16177  * else:
16178  */
16179  goto __pyx_L19;
16180  }
16181 
16182  /* "View.MemoryView":868
16183  * stop = -1
16184  * else:
16185  * stop = shape # <<<<<<<<<<<<<<
16186  *
16187  * if not have_step:
16188  */
16189  /*else*/ {
16190  __pyx_v_stop = __pyx_v_shape;
16191  }
16192  __pyx_L19:;
16193  }
16194  __pyx_L16:;
16195 
16196  /* "View.MemoryView":870
16197  * stop = shape
16198  *
16199  * if not have_step: # <<<<<<<<<<<<<<
16200  * step = 1
16201  *
16202  */
16203  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
16204  if (__pyx_t_2) {
16205 
16206  /* "View.MemoryView":871
16207  *
16208  * if not have_step:
16209  * step = 1 # <<<<<<<<<<<<<<
16210  *
16211  *
16212  */
16213  __pyx_v_step = 1;
16214 
16215  /* "View.MemoryView":870
16216  * stop = shape
16217  *
16218  * if not have_step: # <<<<<<<<<<<<<<
16219  * step = 1
16220  *
16221  */
16222  }
16223 
16224  /* "View.MemoryView":875
16225  *
16226  * with cython.cdivision(True):
16227  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
16228  *
16229  * if (stop - start) - step * new_shape:
16230  */
16231  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16232 
16233  /* "View.MemoryView":877
16234  * new_shape = (stop - start) // step
16235  *
16236  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16237  * new_shape += 1
16238  *
16239  */
16240  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16241  if (__pyx_t_2) {
16242 
16243  /* "View.MemoryView":878
16244  *
16245  * if (stop - start) - step * new_shape:
16246  * new_shape += 1 # <<<<<<<<<<<<<<
16247  *
16248  * if new_shape < 0:
16249  */
16250  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16251 
16252  /* "View.MemoryView":877
16253  * new_shape = (stop - start) // step
16254  *
16255  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16256  * new_shape += 1
16257  *
16258  */
16259  }
16260 
16261  /* "View.MemoryView":880
16262  * new_shape += 1
16263  *
16264  * if new_shape < 0: # <<<<<<<<<<<<<<
16265  * new_shape = 0
16266  *
16267  */
16268  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16269  if (__pyx_t_2) {
16270 
16271  /* "View.MemoryView":881
16272  *
16273  * if new_shape < 0:
16274  * new_shape = 0 # <<<<<<<<<<<<<<
16275  *
16276  *
16277  */
16278  __pyx_v_new_shape = 0;
16279 
16280  /* "View.MemoryView":880
16281  * new_shape += 1
16282  *
16283  * if new_shape < 0: # <<<<<<<<<<<<<<
16284  * new_shape = 0
16285  *
16286  */
16287  }
16288 
16289  /* "View.MemoryView":884
16290  *
16291  *
16292  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
16293  * dst.shape[new_ndim] = new_shape
16294  * dst.suboffsets[new_ndim] = suboffset
16295  */
16296  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16297 
16298  /* "View.MemoryView":885
16299  *
16300  * dst.strides[new_ndim] = stride * step
16301  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
16302  * dst.suboffsets[new_ndim] = suboffset
16303  *
16304  */
16305  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16306 
16307  /* "View.MemoryView":886
16308  * dst.strides[new_ndim] = stride * step
16309  * dst.shape[new_ndim] = new_shape
16310  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
16311  *
16312  *
16313  */
16314  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16315  }
16316  __pyx_L3:;
16317 
16318  /* "View.MemoryView":889
16319  *
16320  *
16321  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16322  * dst.data += start * stride
16323  * else:
16324  */
16325  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16326  if (__pyx_t_2) {
16327 
16328  /* "View.MemoryView":890
16329  *
16330  * if suboffset_dim[0] < 0:
16331  * dst.data += start * stride # <<<<<<<<<<<<<<
16332  * else:
16333  * dst.suboffsets[suboffset_dim[0]] += start * stride
16334  */
16335  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16336 
16337  /* "View.MemoryView":889
16338  *
16339  *
16340  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16341  * dst.data += start * stride
16342  * else:
16343  */
16344  goto __pyx_L23;
16345  }
16346 
16347  /* "View.MemoryView":892
16348  * dst.data += start * stride
16349  * else:
16350  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
16351  *
16352  * if suboffset >= 0:
16353  */
16354  /*else*/ {
16355  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16356  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16357  }
16358  __pyx_L23:;
16359 
16360  /* "View.MemoryView":894
16361  * dst.suboffsets[suboffset_dim[0]] += start * stride
16362  *
16363  * if suboffset >= 0: # <<<<<<<<<<<<<<
16364  * if not is_slice:
16365  * if new_ndim == 0:
16366  */
16367  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16368  if (__pyx_t_2) {
16369 
16370  /* "View.MemoryView":895
16371  *
16372  * if suboffset >= 0:
16373  * if not is_slice: # <<<<<<<<<<<<<<
16374  * if new_ndim == 0:
16375  * dst.data = (<char **> dst.data)[0] + suboffset
16376  */
16377  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16378  if (__pyx_t_2) {
16379 
16380  /* "View.MemoryView":896
16381  * if suboffset >= 0:
16382  * if not is_slice:
16383  * if new_ndim == 0: # <<<<<<<<<<<<<<
16384  * dst.data = (<char **> dst.data)[0] + suboffset
16385  * else:
16386  */
16387  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16388  if (__pyx_t_2) {
16389 
16390  /* "View.MemoryView":897
16391  * if not is_slice:
16392  * if new_ndim == 0:
16393  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
16394  * else:
16395  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16396  */
16397  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16398 
16399  /* "View.MemoryView":896
16400  * if suboffset >= 0:
16401  * if not is_slice:
16402  * if new_ndim == 0: # <<<<<<<<<<<<<<
16403  * dst.data = (<char **> dst.data)[0] + suboffset
16404  * else:
16405  */
16406  goto __pyx_L26;
16407  }
16408 
16409  /* "View.MemoryView":899
16410  * dst.data = (<char **> dst.data)[0] + suboffset
16411  * else:
16412  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
16413  * "must be indexed and not sliced", dim)
16414  * else:
16415  */
16416  /*else*/ {
16417 
16418  /* "View.MemoryView":900
16419  * else:
16420  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16421  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
16422  * else:
16423  * suboffset_dim[0] = new_ndim
16424  */
16425  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 899, __pyx_L1_error)
16426  }
16427  __pyx_L26:;
16428 
16429  /* "View.MemoryView":895
16430  *
16431  * if suboffset >= 0:
16432  * if not is_slice: # <<<<<<<<<<<<<<
16433  * if new_ndim == 0:
16434  * dst.data = (<char **> dst.data)[0] + suboffset
16435  */
16436  goto __pyx_L25;
16437  }
16438 
16439  /* "View.MemoryView":902
16440  * "must be indexed and not sliced", dim)
16441  * else:
16442  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
16443  *
16444  * return 0
16445  */
16446  /*else*/ {
16447  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16448  }
16449  __pyx_L25:;
16450 
16451  /* "View.MemoryView":894
16452  * dst.suboffsets[suboffset_dim[0]] += start * stride
16453  *
16454  * if suboffset >= 0: # <<<<<<<<<<<<<<
16455  * if not is_slice:
16456  * if new_ndim == 0:
16457  */
16458  }
16459 
16460  /* "View.MemoryView":904
16461  * suboffset_dim[0] = new_ndim
16462  *
16463  * return 0 # <<<<<<<<<<<<<<
16464  *
16465  *
16466  */
16467  __pyx_r = 0;
16468  goto __pyx_L0;
16469 
16470  /* "View.MemoryView":807
16471  *
16472  * @cname('__pyx_memoryview_slice_memviewslice')
16473  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16474  * __Pyx_memviewslice *dst,
16475  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16476  */
16477 
16478  /* function exit code */
16479  __pyx_L1_error:;
16480  {
16481  #ifdef WITH_THREAD
16482  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16483  #endif
16484  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16485  #ifdef WITH_THREAD
16486  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16487  #endif
16488  }
16489  __pyx_r = -1;
16490  __pyx_L0:;
16491  __Pyx_TraceReturn(Py_None, 1);
16492  return __pyx_r;
16493 }
16494 
16495 /* "View.MemoryView":910
16496  *
16497  * @cname('__pyx_pybuffer_index')
16498  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16499  * Py_ssize_t dim) except NULL:
16500  * cdef Py_ssize_t shape, stride, suboffset = -1
16501  */
16502 
16503 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
16504  Py_ssize_t __pyx_v_shape;
16505  Py_ssize_t __pyx_v_stride;
16506  Py_ssize_t __pyx_v_suboffset;
16507  Py_ssize_t __pyx_v_itemsize;
16508  char *__pyx_v_resultp;
16509  char *__pyx_r;
16510  __Pyx_TraceDeclarations
16511  __Pyx_RefNannyDeclarations
16512  Py_ssize_t __pyx_t_1;
16513  int __pyx_t_2;
16514  PyObject *__pyx_t_3 = NULL;
16515  PyObject *__pyx_t_4 = NULL;
16516  int __pyx_lineno = 0;
16517  const char *__pyx_filename = NULL;
16518  int __pyx_clineno = 0;
16519  __Pyx_RefNannySetupContext("pybuffer_index", 0);
16520  __Pyx_TraceCall("pybuffer_index", __pyx_f[1], 910, 0, __PYX_ERR(1, 910, __pyx_L1_error));
16521 
16522  /* "View.MemoryView":912
16523  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
16524  * Py_ssize_t dim) except NULL:
16525  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
16526  * cdef Py_ssize_t itemsize = view.itemsize
16527  * cdef char *resultp
16528  */
16529  __pyx_v_suboffset = -1L;
16530 
16531  /* "View.MemoryView":913
16532  * Py_ssize_t dim) except NULL:
16533  * cdef Py_ssize_t shape, stride, suboffset = -1
16534  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
16535  * cdef char *resultp
16536  *
16537  */
16538  __pyx_t_1 = __pyx_v_view->itemsize;
16539  __pyx_v_itemsize = __pyx_t_1;
16540 
16541  /* "View.MemoryView":916
16542  * cdef char *resultp
16543  *
16544  * if view.ndim == 0: # <<<<<<<<<<<<<<
16545  * shape = view.len / itemsize
16546  * stride = itemsize
16547  */
16548  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
16549  if (__pyx_t_2) {
16550 
16551  /* "View.MemoryView":917
16552  *
16553  * if view.ndim == 0:
16554  * shape = view.len / itemsize # <<<<<<<<<<<<<<
16555  * stride = itemsize
16556  * else:
16557  */
16558  if (unlikely(__pyx_v_itemsize == 0)) {
16559  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
16560  __PYX_ERR(1, 917, __pyx_L1_error)
16561  }
16562  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
16563  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
16564  __PYX_ERR(1, 917, __pyx_L1_error)
16565  }
16566  __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
16567 
16568  /* "View.MemoryView":918
16569  * if view.ndim == 0:
16570  * shape = view.len / itemsize
16571  * stride = itemsize # <<<<<<<<<<<<<<
16572  * else:
16573  * shape = view.shape[dim]
16574  */
16575  __pyx_v_stride = __pyx_v_itemsize;
16576 
16577  /* "View.MemoryView":916
16578  * cdef char *resultp
16579  *
16580  * if view.ndim == 0: # <<<<<<<<<<<<<<
16581  * shape = view.len / itemsize
16582  * stride = itemsize
16583  */
16584  goto __pyx_L3;
16585  }
16586 
16587  /* "View.MemoryView":920
16588  * stride = itemsize
16589  * else:
16590  * shape = view.shape[dim] # <<<<<<<<<<<<<<
16591  * stride = view.strides[dim]
16592  * if view.suboffsets != NULL:
16593  */
16594  /*else*/ {
16595  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
16596 
16597  /* "View.MemoryView":921
16598  * else:
16599  * shape = view.shape[dim]
16600  * stride = view.strides[dim] # <<<<<<<<<<<<<<
16601  * if view.suboffsets != NULL:
16602  * suboffset = view.suboffsets[dim]
16603  */
16604  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
16605 
16606  /* "View.MemoryView":922
16607  * shape = view.shape[dim]
16608  * stride = view.strides[dim]
16609  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16610  * suboffset = view.suboffsets[dim]
16611  *
16612  */
16613  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
16614  if (__pyx_t_2) {
16615 
16616  /* "View.MemoryView":923
16617  * stride = view.strides[dim]
16618  * if view.suboffsets != NULL:
16619  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
16620  *
16621  * if index < 0:
16622  */
16623  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
16624 
16625  /* "View.MemoryView":922
16626  * shape = view.shape[dim]
16627  * stride = view.strides[dim]
16628  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16629  * suboffset = view.suboffsets[dim]
16630  *
16631  */
16632  }
16633  }
16634  __pyx_L3:;
16635 
16636  /* "View.MemoryView":925
16637  * suboffset = view.suboffsets[dim]
16638  *
16639  * if index < 0: # <<<<<<<<<<<<<<
16640  * index += view.shape[dim]
16641  * if index < 0:
16642  */
16643  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16644  if (__pyx_t_2) {
16645 
16646  /* "View.MemoryView":926
16647  *
16648  * if index < 0:
16649  * index += view.shape[dim] # <<<<<<<<<<<<<<
16650  * if index < 0:
16651  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16652  */
16653  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
16654 
16655  /* "View.MemoryView":927
16656  * if index < 0:
16657  * index += view.shape[dim]
16658  * if index < 0: # <<<<<<<<<<<<<<
16659  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16660  *
16661  */
16662  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16663  if (unlikely(__pyx_t_2)) {
16664 
16665  /* "View.MemoryView":928
16666  * index += view.shape[dim]
16667  * if index < 0:
16668  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
16669  *
16670  * if index >= shape:
16671  */
16672  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
16673  __Pyx_GOTREF(__pyx_t_3);
16674  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error)
16675  __Pyx_GOTREF(__pyx_t_4);
16676  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16677  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
16678  __Pyx_GOTREF(__pyx_t_3);
16679  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16680  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16681  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16682  __PYX_ERR(1, 928, __pyx_L1_error)
16683 
16684  /* "View.MemoryView":927
16685  * if index < 0:
16686  * index += view.shape[dim]
16687  * if index < 0: # <<<<<<<<<<<<<<
16688  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16689  *
16690  */
16691  }
16692 
16693  /* "View.MemoryView":925
16694  * suboffset = view.suboffsets[dim]
16695  *
16696  * if index < 0: # <<<<<<<<<<<<<<
16697  * index += view.shape[dim]
16698  * if index < 0:
16699  */
16700  }
16701 
16702  /* "View.MemoryView":930
16703  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16704  *
16705  * if index >= shape: # <<<<<<<<<<<<<<
16706  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16707  *
16708  */
16709  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
16710  if (unlikely(__pyx_t_2)) {
16711 
16712  /* "View.MemoryView":931
16713  *
16714  * if index >= shape:
16715  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
16716  *
16717  * resultp = bufp + index * stride
16718  */
16719  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
16720  __Pyx_GOTREF(__pyx_t_3);
16721  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error)
16722  __Pyx_GOTREF(__pyx_t_4);
16723  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16724  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
16725  __Pyx_GOTREF(__pyx_t_3);
16726  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16727  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16728  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16729  __PYX_ERR(1, 931, __pyx_L1_error)
16730 
16731  /* "View.MemoryView":930
16732  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16733  *
16734  * if index >= shape: # <<<<<<<<<<<<<<
16735  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16736  *
16737  */
16738  }
16739 
16740  /* "View.MemoryView":933
16741  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16742  *
16743  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
16744  * if suboffset >= 0:
16745  * resultp = (<char **> resultp)[0] + suboffset
16746  */
16747  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
16748 
16749  /* "View.MemoryView":934
16750  *
16751  * resultp = bufp + index * stride
16752  * if suboffset >= 0: # <<<<<<<<<<<<<<
16753  * resultp = (<char **> resultp)[0] + suboffset
16754  *
16755  */
16756  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16757  if (__pyx_t_2) {
16758 
16759  /* "View.MemoryView":935
16760  * resultp = bufp + index * stride
16761  * if suboffset >= 0:
16762  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
16763  *
16764  * return resultp
16765  */
16766  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
16767 
16768  /* "View.MemoryView":934
16769  *
16770  * resultp = bufp + index * stride
16771  * if suboffset >= 0: # <<<<<<<<<<<<<<
16772  * resultp = (<char **> resultp)[0] + suboffset
16773  *
16774  */
16775  }
16776 
16777  /* "View.MemoryView":937
16778  * resultp = (<char **> resultp)[0] + suboffset
16779  *
16780  * return resultp # <<<<<<<<<<<<<<
16781  *
16782  *
16783  */
16784  __pyx_r = __pyx_v_resultp;
16785  goto __pyx_L0;
16786 
16787  /* "View.MemoryView":910
16788  *
16789  * @cname('__pyx_pybuffer_index')
16790  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16791  * Py_ssize_t dim) except NULL:
16792  * cdef Py_ssize_t shape, stride, suboffset = -1
16793  */
16794 
16795  /* function exit code */
16796  __pyx_L1_error:;
16797  __Pyx_XDECREF(__pyx_t_3);
16798  __Pyx_XDECREF(__pyx_t_4);
16799  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
16800  __pyx_r = NULL;
16801  __pyx_L0:;
16802  __Pyx_TraceReturn(Py_None, 0);
16803  __Pyx_RefNannyFinishContext();
16804  return __pyx_r;
16805 }
16806 
16807 /* "View.MemoryView":943
16808  *
16809  * @cname('__pyx_memslice_transpose')
16810  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
16811  * cdef int ndim = memslice.memview.view.ndim
16812  *
16813  */
16814 
16815 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
16816  int __pyx_v_ndim;
16817  Py_ssize_t *__pyx_v_shape;
16818  Py_ssize_t *__pyx_v_strides;
16819  int __pyx_v_i;
16820  int __pyx_v_j;
16821  int __pyx_r;
16822  __Pyx_TraceDeclarations
16823  int __pyx_t_1;
16824  Py_ssize_t *__pyx_t_2;
16825  long __pyx_t_3;
16826  long __pyx_t_4;
16827  Py_ssize_t __pyx_t_5;
16828  Py_ssize_t __pyx_t_6;
16829  int __pyx_t_7;
16830  int __pyx_t_8;
16831  int __pyx_t_9;
16832  int __pyx_lineno = 0;
16833  const char *__pyx_filename = NULL;
16834  int __pyx_clineno = 0;
16835  __Pyx_TraceCall("transpose_memslice", __pyx_f[1], 943, 1, __PYX_ERR(1, 943, __pyx_L1_error));
16836 
16837  /* "View.MemoryView":944
16838  * @cname('__pyx_memslice_transpose')
16839  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
16840  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
16841  *
16842  * cdef Py_ssize_t *shape = memslice.shape
16843  */
16844  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
16845  __pyx_v_ndim = __pyx_t_1;
16846 
16847  /* "View.MemoryView":946
16848  * cdef int ndim = memslice.memview.view.ndim
16849  *
16850  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
16851  * cdef Py_ssize_t *strides = memslice.strides
16852  *
16853  */
16854  __pyx_t_2 = __pyx_v_memslice->shape;
16855  __pyx_v_shape = __pyx_t_2;
16856 
16857  /* "View.MemoryView":947
16858  *
16859  * cdef Py_ssize_t *shape = memslice.shape
16860  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
16861  *
16862  *
16863  */
16864  __pyx_t_2 = __pyx_v_memslice->strides;
16865  __pyx_v_strides = __pyx_t_2;
16866 
16867  /* "View.MemoryView":951
16868  *
16869  * cdef int i, j
16870  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
16871  * j = ndim - 1 - i
16872  * strides[i], strides[j] = strides[j], strides[i]
16873  */
16874  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
16875  __pyx_t_4 = __pyx_t_3;
16876  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
16877  __pyx_v_i = __pyx_t_1;
16878 
16879  /* "View.MemoryView":952
16880  * cdef int i, j
16881  * for i in range(ndim / 2):
16882  * j = ndim - 1 - i # <<<<<<<<<<<<<<
16883  * strides[i], strides[j] = strides[j], strides[i]
16884  * shape[i], shape[j] = shape[j], shape[i]
16885  */
16886  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
16887 
16888  /* "View.MemoryView":953
16889  * for i in range(ndim / 2):
16890  * j = ndim - 1 - i
16891  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
16892  * shape[i], shape[j] = shape[j], shape[i]
16893  *
16894  */
16895  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
16896  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
16897  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
16898  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
16899 
16900  /* "View.MemoryView":954
16901  * j = ndim - 1 - i
16902  * strides[i], strides[j] = strides[j], strides[i]
16903  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
16904  *
16905  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
16906  */
16907  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
16908  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
16909  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
16910  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
16911 
16912  /* "View.MemoryView":956
16913  * shape[i], shape[j] = shape[j], shape[i]
16914  *
16915  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
16916  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16917  *
16918  */
16919  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
16920  if (!__pyx_t_8) {
16921  } else {
16922  __pyx_t_7 = __pyx_t_8;
16923  goto __pyx_L6_bool_binop_done;
16924  }
16925  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
16926  __pyx_t_7 = __pyx_t_8;
16927  __pyx_L6_bool_binop_done:;
16928  if (__pyx_t_7) {
16929 
16930  /* "View.MemoryView":957
16931  *
16932  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
16933  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
16934  *
16935  * return 1
16936  */
16937  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L1_error)
16938 
16939  /* "View.MemoryView":956
16940  * shape[i], shape[j] = shape[j], shape[i]
16941  *
16942  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
16943  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16944  *
16945  */
16946  }
16947  }
16948 
16949  /* "View.MemoryView":959
16950  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16951  *
16952  * return 1 # <<<<<<<<<<<<<<
16953  *
16954  *
16955  */
16956  __pyx_r = 1;
16957  goto __pyx_L0;
16958 
16959  /* "View.MemoryView":943
16960  *
16961  * @cname('__pyx_memslice_transpose')
16962  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
16963  * cdef int ndim = memslice.memview.view.ndim
16964  *
16965  */
16966 
16967  /* function exit code */
16968  __pyx_L1_error:;
16969  {
16970  #ifdef WITH_THREAD
16971  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16972  #endif
16973  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16974  #ifdef WITH_THREAD
16975  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16976  #endif
16977  }
16978  __pyx_r = 0;
16979  __pyx_L0:;
16980  __Pyx_TraceReturn(Py_None, 1);
16981  return __pyx_r;
16982 }
16983 
16984 /* "View.MemoryView":976
16985  * cdef int (*to_dtype_func)(char *, object) except 0
16986  *
16987  * def __dealloc__(self): # <<<<<<<<<<<<<<
16988  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16989  *
16990  */
16991 
16992 /* Python wrapper */
16993 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
16994 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
16995  __Pyx_RefNannyDeclarations
16996  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
16997  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16998 
16999  /* function exit code */
17000  __Pyx_RefNannyFinishContext();
17001 }
17002 
17003 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17004  __Pyx_TraceDeclarations
17005  __Pyx_RefNannyDeclarations
17006  int __pyx_lineno = 0;
17007  const char *__pyx_filename = NULL;
17008  int __pyx_clineno = 0;
17009  __Pyx_RefNannySetupContext("__dealloc__", 0);
17010  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 976, 0, __PYX_ERR(1, 976, __pyx_L1_error));
17011 
17012  /* "View.MemoryView":977
17013  *
17014  * def __dealloc__(self):
17015  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
17016  *
17017  * cdef convert_item_to_object(self, char *itemp):
17018  */
17019  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
17020 
17021  /* "View.MemoryView":976
17022  * cdef int (*to_dtype_func)(char *, object) except 0
17023  *
17024  * def __dealloc__(self): # <<<<<<<<<<<<<<
17025  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17026  *
17027  */
17028 
17029  /* function exit code */
17030  goto __pyx_L0;
17031  __pyx_L1_error:;
17032  __Pyx_WriteUnraisable("View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17033  __pyx_L0:;
17034  __Pyx_TraceReturn(Py_None, 0);
17035  __Pyx_RefNannyFinishContext();
17036 }
17037 
17038 /* "View.MemoryView":979
17039  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17040  *
17041  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17042  * if self.to_object_func != NULL:
17043  * return self.to_object_func(itemp)
17044  */
17045 
17046 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
17047  PyObject *__pyx_r = NULL;
17048  __Pyx_TraceDeclarations
17049  __Pyx_RefNannyDeclarations
17050  int __pyx_t_1;
17051  PyObject *__pyx_t_2 = NULL;
17052  int __pyx_lineno = 0;
17053  const char *__pyx_filename = NULL;
17054  int __pyx_clineno = 0;
17055  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
17056  __Pyx_TraceCall("convert_item_to_object", __pyx_f[1], 979, 0, __PYX_ERR(1, 979, __pyx_L1_error));
17057 
17058  /* "View.MemoryView":980
17059  *
17060  * cdef convert_item_to_object(self, char *itemp):
17061  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17062  * return self.to_object_func(itemp)
17063  * else:
17064  */
17065  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
17066  if (__pyx_t_1) {
17067 
17068  /* "View.MemoryView":981
17069  * cdef convert_item_to_object(self, char *itemp):
17070  * if self.to_object_func != NULL:
17071  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
17072  * else:
17073  * return memoryview.convert_item_to_object(self, itemp)
17074  */
17075  __Pyx_XDECREF(__pyx_r);
17076  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
17077  __Pyx_GOTREF(__pyx_t_2);
17078  __pyx_r = __pyx_t_2;
17079  __pyx_t_2 = 0;
17080  goto __pyx_L0;
17081 
17082  /* "View.MemoryView":980
17083  *
17084  * cdef convert_item_to_object(self, char *itemp):
17085  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17086  * return self.to_object_func(itemp)
17087  * else:
17088  */
17089  }
17090 
17091  /* "View.MemoryView":983
17092  * return self.to_object_func(itemp)
17093  * else:
17094  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
17095  *
17096  * cdef assign_item_from_object(self, char *itemp, object value):
17097  */
17098  /*else*/ {
17099  __Pyx_XDECREF(__pyx_r);
17100  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
17101  __Pyx_GOTREF(__pyx_t_2);
17102  __pyx_r = __pyx_t_2;
17103  __pyx_t_2 = 0;
17104  goto __pyx_L0;
17105  }
17106 
17107  /* "View.MemoryView":979
17108  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17109  *
17110  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17111  * if self.to_object_func != NULL:
17112  * return self.to_object_func(itemp)
17113  */
17114 
17115  /* function exit code */
17116  __pyx_L1_error:;
17117  __Pyx_XDECREF(__pyx_t_2);
17118  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17119  __pyx_r = 0;
17120  __pyx_L0:;
17121  __Pyx_XGIVEREF(__pyx_r);
17122  __Pyx_TraceReturn(__pyx_r, 0);
17123  __Pyx_RefNannyFinishContext();
17124  return __pyx_r;
17125 }
17126 
17127 /* "View.MemoryView":985
17128  * return memoryview.convert_item_to_object(self, itemp)
17129  *
17130  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17131  * if self.to_dtype_func != NULL:
17132  * self.to_dtype_func(itemp, value)
17133  */
17134 
17135 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
17136  PyObject *__pyx_r = NULL;
17137  __Pyx_TraceDeclarations
17138  __Pyx_RefNannyDeclarations
17139  int __pyx_t_1;
17140  int __pyx_t_2;
17141  PyObject *__pyx_t_3 = NULL;
17142  int __pyx_lineno = 0;
17143  const char *__pyx_filename = NULL;
17144  int __pyx_clineno = 0;
17145  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
17146  __Pyx_TraceCall("assign_item_from_object", __pyx_f[1], 985, 0, __PYX_ERR(1, 985, __pyx_L1_error));
17147 
17148  /* "View.MemoryView":986
17149  *
17150  * cdef assign_item_from_object(self, char *itemp, object value):
17151  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17152  * self.to_dtype_func(itemp, value)
17153  * else:
17154  */
17155  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
17156  if (__pyx_t_1) {
17157 
17158  /* "View.MemoryView":987
17159  * cdef assign_item_from_object(self, char *itemp, object value):
17160  * if self.to_dtype_func != NULL:
17161  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
17162  * else:
17163  * memoryview.assign_item_from_object(self, itemp, value)
17164  */
17165  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 987, __pyx_L1_error)
17166 
17167  /* "View.MemoryView":986
17168  *
17169  * cdef assign_item_from_object(self, char *itemp, object value):
17170  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17171  * self.to_dtype_func(itemp, value)
17172  * else:
17173  */
17174  goto __pyx_L3;
17175  }
17176 
17177  /* "View.MemoryView":989
17178  * self.to_dtype_func(itemp, value)
17179  * else:
17180  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
17181  *
17182  * @property
17183  */
17184  /*else*/ {
17185  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error)
17186  __Pyx_GOTREF(__pyx_t_3);
17187  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17188  }
17189  __pyx_L3:;
17190 
17191  /* "View.MemoryView":985
17192  * return memoryview.convert_item_to_object(self, itemp)
17193  *
17194  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17195  * if self.to_dtype_func != NULL:
17196  * self.to_dtype_func(itemp, value)
17197  */
17198 
17199  /* function exit code */
17200  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17201  goto __pyx_L0;
17202  __pyx_L1_error:;
17203  __Pyx_XDECREF(__pyx_t_3);
17204  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17205  __pyx_r = 0;
17206  __pyx_L0:;
17207  __Pyx_XGIVEREF(__pyx_r);
17208  __Pyx_TraceReturn(__pyx_r, 0);
17209  __Pyx_RefNannyFinishContext();
17210  return __pyx_r;
17211 }
17212 
17213 /* "View.MemoryView":992
17214  *
17215  * @property
17216  * def base(self): # <<<<<<<<<<<<<<
17217  * return self.from_object
17218  *
17219  */
17220 
17221 /* Python wrapper */
17222 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
17223 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
17224  PyObject *__pyx_r = 0;
17225  __Pyx_RefNannyDeclarations
17226  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17227  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17228 
17229  /* function exit code */
17230  __Pyx_RefNannyFinishContext();
17231  return __pyx_r;
17232 }
17233 
17234 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17235  PyObject *__pyx_r = NULL;
17236  __Pyx_TraceDeclarations
17237  __Pyx_RefNannyDeclarations
17238  int __pyx_lineno = 0;
17239  const char *__pyx_filename = NULL;
17240  int __pyx_clineno = 0;
17241  __Pyx_RefNannySetupContext("__get__", 0);
17242  __Pyx_TraceCall("__get__", __pyx_f[1], 992, 0, __PYX_ERR(1, 992, __pyx_L1_error));
17243 
17244  /* "View.MemoryView":993
17245  * @property
17246  * def base(self):
17247  * return self.from_object # <<<<<<<<<<<<<<
17248  *
17249  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
17250  */
17251  __Pyx_XDECREF(__pyx_r);
17252  __Pyx_INCREF(__pyx_v_self->from_object);
17253  __pyx_r = __pyx_v_self->from_object;
17254  goto __pyx_L0;
17255 
17256  /* "View.MemoryView":992
17257  *
17258  * @property
17259  * def base(self): # <<<<<<<<<<<<<<
17260  * return self.from_object
17261  *
17262  */
17263 
17264  /* function exit code */
17265  __pyx_L1_error:;
17266  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17267  __pyx_r = NULL;
17268  __pyx_L0:;
17269  __Pyx_XGIVEREF(__pyx_r);
17270  __Pyx_TraceReturn(__pyx_r, 0);
17271  __Pyx_RefNannyFinishContext();
17272  return __pyx_r;
17273 }
17274 
17275 /* "(tree fragment)":1
17276  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17277  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17278  * def __setstate_cython__(self, __pyx_state):
17279  */
17280 
17281 /* Python wrapper */
17282 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
17283 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
17284 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17285  PyObject *__pyx_r = 0;
17286  __Pyx_RefNannyDeclarations
17287  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
17288  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17289 
17290  /* function exit code */
17291  __Pyx_RefNannyFinishContext();
17292  return __pyx_r;
17293 }
17294 
17295 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17296  PyObject *__pyx_r = NULL;
17297  __Pyx_TraceDeclarations
17298  __Pyx_RefNannyDeclarations
17299  PyObject *__pyx_t_1 = NULL;
17300  int __pyx_lineno = 0;
17301  const char *__pyx_filename = NULL;
17302  int __pyx_clineno = 0;
17303  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
17304  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
17305 
17306  /* "(tree fragment)":2
17307  * def __reduce_cython__(self):
17308  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17309  * def __setstate_cython__(self, __pyx_state):
17310  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17311  */
17312  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
17313  __Pyx_GOTREF(__pyx_t_1);
17314  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17315  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17316  __PYX_ERR(1, 2, __pyx_L1_error)
17317 
17318  /* "(tree fragment)":1
17319  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17320  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17321  * def __setstate_cython__(self, __pyx_state):
17322  */
17323 
17324  /* function exit code */
17325  __pyx_L1_error:;
17326  __Pyx_XDECREF(__pyx_t_1);
17327  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17328  __pyx_r = NULL;
17329  __Pyx_XGIVEREF(__pyx_r);
17330  __Pyx_TraceReturn(__pyx_r, 0);
17331  __Pyx_RefNannyFinishContext();
17332  return __pyx_r;
17333 }
17334 
17335 /* "(tree fragment)":3
17336  * def __reduce_cython__(self):
17337  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17338  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17339  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17340  */
17341 
17342 /* Python wrapper */
17343 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
17344 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
17345 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17346  PyObject *__pyx_r = 0;
17347  __Pyx_RefNannyDeclarations
17348  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
17349  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17350 
17351  /* function exit code */
17352  __Pyx_RefNannyFinishContext();
17353  return __pyx_r;
17354 }
17355 
17356 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
17357  PyObject *__pyx_r = NULL;
17358  __Pyx_TraceDeclarations
17359  __Pyx_RefNannyDeclarations
17360  PyObject *__pyx_t_1 = NULL;
17361  int __pyx_lineno = 0;
17362  const char *__pyx_filename = NULL;
17363  int __pyx_clineno = 0;
17364  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
17365  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
17366 
17367  /* "(tree fragment)":4
17368  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17369  * def __setstate_cython__(self, __pyx_state):
17370  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17371  */
17372  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
17373  __Pyx_GOTREF(__pyx_t_1);
17374  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17375  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17376  __PYX_ERR(1, 4, __pyx_L1_error)
17377 
17378  /* "(tree fragment)":3
17379  * def __reduce_cython__(self):
17380  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17381  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17382  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17383  */
17384 
17385  /* function exit code */
17386  __pyx_L1_error:;
17387  __Pyx_XDECREF(__pyx_t_1);
17388  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17389  __pyx_r = NULL;
17390  __Pyx_XGIVEREF(__pyx_r);
17391  __Pyx_TraceReturn(__pyx_r, 0);
17392  __Pyx_RefNannyFinishContext();
17393  return __pyx_r;
17394 }
17395 
17396 /* "View.MemoryView":999
17397  *
17398  * @cname('__pyx_memoryview_fromslice')
17399  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17400  * int ndim,
17401  * object (*to_object_func)(char *),
17402  */
17403 
17404 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
17405  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17406  Py_ssize_t __pyx_v_suboffset;
17407  PyObject *__pyx_v_length = NULL;
17408  PyObject *__pyx_r = NULL;
17409  __Pyx_TraceDeclarations
17410  __Pyx_RefNannyDeclarations
17411  int __pyx_t_1;
17412  PyObject *__pyx_t_2 = NULL;
17413  PyObject *__pyx_t_3 = NULL;
17414  __Pyx_TypeInfo *__pyx_t_4;
17415  Py_buffer __pyx_t_5;
17416  Py_ssize_t *__pyx_t_6;
17417  Py_ssize_t *__pyx_t_7;
17418  Py_ssize_t *__pyx_t_8;
17419  Py_ssize_t __pyx_t_9;
17420  int __pyx_lineno = 0;
17421  const char *__pyx_filename = NULL;
17422  int __pyx_clineno = 0;
17423  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
17424  __Pyx_TraceCall("memoryview_fromslice", __pyx_f[1], 999, 0, __PYX_ERR(1, 999, __pyx_L1_error));
17425 
17426  /* "View.MemoryView":1007
17427  * cdef _memoryviewslice result
17428  *
17429  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17430  * return None
17431  *
17432  */
17433  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17434  if (__pyx_t_1) {
17435 
17436  /* "View.MemoryView":1008
17437  *
17438  * if <PyObject *> memviewslice.memview == Py_None:
17439  * return None # <<<<<<<<<<<<<<
17440  *
17441  *
17442  */
17443  __Pyx_XDECREF(__pyx_r);
17444  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17445  goto __pyx_L0;
17446 
17447  /* "View.MemoryView":1007
17448  * cdef _memoryviewslice result
17449  *
17450  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17451  * return None
17452  *
17453  */
17454  }
17455 
17456  /* "View.MemoryView":1013
17457  *
17458  *
17459  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
17460  *
17461  * result.from_slice = memviewslice
17462  */
17463  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17464  __Pyx_GOTREF(__pyx_t_2);
17465  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
17466  __Pyx_GOTREF(__pyx_t_3);
17467  __Pyx_INCREF(Py_None);
17468  __Pyx_GIVEREF(Py_None);
17469  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17470  __Pyx_INCREF(__pyx_int_0);
17471  __Pyx_GIVEREF(__pyx_int_0);
17472  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17473  __Pyx_GIVEREF(__pyx_t_2);
17474  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17475  __pyx_t_2 = 0;
17476  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17477  __Pyx_GOTREF(__pyx_t_2);
17478  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17479  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17480  __pyx_t_2 = 0;
17481 
17482  /* "View.MemoryView":1015
17483  * result = _memoryviewslice(None, 0, dtype_is_object)
17484  *
17485  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
17486  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17487  *
17488  */
17489  __pyx_v_result->from_slice = __pyx_v_memviewslice;
17490 
17491  /* "View.MemoryView":1016
17492  *
17493  * result.from_slice = memviewslice
17494  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
17495  *
17496  * result.from_object = (<memoryview> memviewslice.memview).base
17497  */
17498  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17499 
17500  /* "View.MemoryView":1018
17501  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17502  *
17503  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
17504  * result.typeinfo = memviewslice.memview.typeinfo
17505  *
17506  */
17507  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
17508  __Pyx_GOTREF(__pyx_t_2);
17509  __Pyx_GIVEREF(__pyx_t_2);
17510  __Pyx_GOTREF(__pyx_v_result->from_object);
17511  __Pyx_DECREF(__pyx_v_result->from_object);
17512  __pyx_v_result->from_object = __pyx_t_2;
17513  __pyx_t_2 = 0;
17514 
17515  /* "View.MemoryView":1019
17516  *
17517  * result.from_object = (<memoryview> memviewslice.memview).base
17518  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
17519  *
17520  * result.view = memviewslice.memview.view
17521  */
17522  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17523  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17524 
17525  /* "View.MemoryView":1021
17526  * result.typeinfo = memviewslice.memview.typeinfo
17527  *
17528  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
17529  * result.view.buf = <void *> memviewslice.data
17530  * result.view.ndim = ndim
17531  */
17532  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17533  __pyx_v_result->__pyx_base.view = __pyx_t_5;
17534 
17535  /* "View.MemoryView":1022
17536  *
17537  * result.view = memviewslice.memview.view
17538  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
17539  * result.view.ndim = ndim
17540  * (<__pyx_buffer *> &result.view).obj = Py_None
17541  */
17542  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
17543 
17544  /* "View.MemoryView":1023
17545  * result.view = memviewslice.memview.view
17546  * result.view.buf = <void *> memviewslice.data
17547  * result.view.ndim = ndim # <<<<<<<<<<<<<<
17548  * (<__pyx_buffer *> &result.view).obj = Py_None
17549  * Py_INCREF(Py_None)
17550  */
17551  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
17552 
17553  /* "View.MemoryView":1024
17554  * result.view.buf = <void *> memviewslice.data
17555  * result.view.ndim = ndim
17556  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
17557  * Py_INCREF(Py_None)
17558  *
17559  */
17560  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
17561 
17562  /* "View.MemoryView":1025
17563  * result.view.ndim = ndim
17564  * (<__pyx_buffer *> &result.view).obj = Py_None
17565  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
17566  *
17567  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17568  */
17569  Py_INCREF(Py_None);
17570 
17571  /* "View.MemoryView":1027
17572  * Py_INCREF(Py_None)
17573  *
17574  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17575  * result.flags = PyBUF_RECORDS
17576  * else:
17577  */
17578  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
17579  if (__pyx_t_1) {
17580 
17581  /* "View.MemoryView":1028
17582  *
17583  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17584  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
17585  * else:
17586  * result.flags = PyBUF_RECORDS_RO
17587  */
17588  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
17589 
17590  /* "View.MemoryView":1027
17591  * Py_INCREF(Py_None)
17592  *
17593  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17594  * result.flags = PyBUF_RECORDS
17595  * else:
17596  */
17597  goto __pyx_L4;
17598  }
17599 
17600  /* "View.MemoryView":1030
17601  * result.flags = PyBUF_RECORDS
17602  * else:
17603  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
17604  *
17605  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17606  */
17607  /*else*/ {
17608  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
17609  }
17610  __pyx_L4:;
17611 
17612  /* "View.MemoryView":1032
17613  * result.flags = PyBUF_RECORDS_RO
17614  *
17615  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
17616  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
17617  *
17618  */
17619  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
17620 
17621  /* "View.MemoryView":1033
17622  *
17623  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17624  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
17625  *
17626  *
17627  */
17628  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
17629 
17630  /* "View.MemoryView":1036
17631  *
17632  *
17633  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
17634  * for suboffset in result.from_slice.suboffsets[:ndim]:
17635  * if suboffset >= 0:
17636  */
17637  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
17638 
17639  /* "View.MemoryView":1037
17640  *
17641  * result.view.suboffsets = NULL
17642  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
17643  * if suboffset >= 0:
17644  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17645  */
17646  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
17647  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17648  __pyx_t_6 = __pyx_t_8;
17649  __pyx_v_suboffset = (__pyx_t_6[0]);
17650 
17651  /* "View.MemoryView":1038
17652  * result.view.suboffsets = NULL
17653  * for suboffset in result.from_slice.suboffsets[:ndim]:
17654  * if suboffset >= 0: # <<<<<<<<<<<<<<
17655  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17656  * break
17657  */
17658  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
17659  if (__pyx_t_1) {
17660 
17661  /* "View.MemoryView":1039
17662  * for suboffset in result.from_slice.suboffsets[:ndim]:
17663  * if suboffset >= 0:
17664  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
17665  * break
17666  *
17667  */
17668  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
17669 
17670  /* "View.MemoryView":1040
17671  * if suboffset >= 0:
17672  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17673  * break # <<<<<<<<<<<<<<
17674  *
17675  * result.view.len = result.view.itemsize
17676  */
17677  goto __pyx_L6_break;
17678 
17679  /* "View.MemoryView":1038
17680  * result.view.suboffsets = NULL
17681  * for suboffset in result.from_slice.suboffsets[:ndim]:
17682  * if suboffset >= 0: # <<<<<<<<<<<<<<
17683  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17684  * break
17685  */
17686  }
17687  }
17688  __pyx_L6_break:;
17689 
17690  /* "View.MemoryView":1042
17691  * break
17692  *
17693  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
17694  * for length in result.view.shape[:ndim]:
17695  * result.view.len *= length
17696  */
17697  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
17698  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17699 
17700  /* "View.MemoryView":1043
17701  *
17702  * result.view.len = result.view.itemsize
17703  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
17704  * result.view.len *= length
17705  *
17706  */
17707  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
17708  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17709  __pyx_t_6 = __pyx_t_8;
17710  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
17711  __Pyx_GOTREF(__pyx_t_2);
17712  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
17713  __pyx_t_2 = 0;
17714 
17715  /* "View.MemoryView":1044
17716  * result.view.len = result.view.itemsize
17717  * for length in result.view.shape[:ndim]:
17718  * result.view.len *= length # <<<<<<<<<<<<<<
17719  *
17720  * result.to_object_func = to_object_func
17721  */
17722  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
17723  __Pyx_GOTREF(__pyx_t_2);
17724  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
17725  __Pyx_GOTREF(__pyx_t_3);
17726  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17727  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
17728  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17729  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17730  }
17731 
17732  /* "View.MemoryView":1046
17733  * result.view.len *= length
17734  *
17735  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
17736  * result.to_dtype_func = to_dtype_func
17737  *
17738  */
17739  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
17740 
17741  /* "View.MemoryView":1047
17742  *
17743  * result.to_object_func = to_object_func
17744  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
17745  *
17746  * return result
17747  */
17748  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
17749 
17750  /* "View.MemoryView":1049
17751  * result.to_dtype_func = to_dtype_func
17752  *
17753  * return result # <<<<<<<<<<<<<<
17754  *
17755  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17756  */
17757  __Pyx_XDECREF(__pyx_r);
17758  __Pyx_INCREF(((PyObject *)__pyx_v_result));
17759  __pyx_r = ((PyObject *)__pyx_v_result);
17760  goto __pyx_L0;
17761 
17762  /* "View.MemoryView":999
17763  *
17764  * @cname('__pyx_memoryview_fromslice')
17765  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17766  * int ndim,
17767  * object (*to_object_func)(char *),
17768  */
17769 
17770  /* function exit code */
17771  __pyx_L1_error:;
17772  __Pyx_XDECREF(__pyx_t_2);
17773  __Pyx_XDECREF(__pyx_t_3);
17774  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17775  __pyx_r = 0;
17776  __pyx_L0:;
17777  __Pyx_XDECREF((PyObject *)__pyx_v_result);
17778  __Pyx_XDECREF(__pyx_v_length);
17779  __Pyx_XGIVEREF(__pyx_r);
17780  __Pyx_TraceReturn(__pyx_r, 0);
17781  __Pyx_RefNannyFinishContext();
17782  return __pyx_r;
17783 }
17784 
17785 /* "View.MemoryView":1052
17786  *
17787  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17788  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
17789  * __Pyx_memviewslice *mslice) except NULL:
17790  * cdef _memoryviewslice obj
17791  */
17792 
17793 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
17794  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
17795  __Pyx_memviewslice *__pyx_r;
17796  __Pyx_TraceDeclarations
17797  __Pyx_RefNannyDeclarations
17798  int __pyx_t_1;
17799  int __pyx_t_2;
17800  PyObject *__pyx_t_3 = NULL;
17801  int __pyx_lineno = 0;
17802  const char *__pyx_filename = NULL;
17803  int __pyx_clineno = 0;
17804  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
17805  __Pyx_TraceCall("get_slice_from_memview", __pyx_f[1], 1052, 0, __PYX_ERR(1, 1052, __pyx_L1_error));
17806 
17807  /* "View.MemoryView":1055
17808  * __Pyx_memviewslice *mslice) except NULL:
17809  * cdef _memoryviewslice obj
17810  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17811  * obj = memview
17812  * return &obj.from_slice
17813  */
17814  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17815  __pyx_t_2 = (__pyx_t_1 != 0);
17816  if (__pyx_t_2) {
17817 
17818  /* "View.MemoryView":1056
17819  * cdef _memoryviewslice obj
17820  * if isinstance(memview, _memoryviewslice):
17821  * obj = memview # <<<<<<<<<<<<<<
17822  * return &obj.from_slice
17823  * else:
17824  */
17825  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
17826  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
17827  __Pyx_INCREF(__pyx_t_3);
17828  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
17829  __pyx_t_3 = 0;
17830 
17831  /* "View.MemoryView":1057
17832  * if isinstance(memview, _memoryviewslice):
17833  * obj = memview
17834  * return &obj.from_slice # <<<<<<<<<<<<<<
17835  * else:
17836  * slice_copy(memview, mslice)
17837  */
17838  __pyx_r = (&__pyx_v_obj->from_slice);
17839  goto __pyx_L0;
17840 
17841  /* "View.MemoryView":1055
17842  * __Pyx_memviewslice *mslice) except NULL:
17843  * cdef _memoryviewslice obj
17844  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17845  * obj = memview
17846  * return &obj.from_slice
17847  */
17848  }
17849 
17850  /* "View.MemoryView":1059
17851  * return &obj.from_slice
17852  * else:
17853  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
17854  * return mslice
17855  *
17856  */
17857  /*else*/ {
17858  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
17859 
17860  /* "View.MemoryView":1060
17861  * else:
17862  * slice_copy(memview, mslice)
17863  * return mslice # <<<<<<<<<<<<<<
17864  *
17865  * @cname('__pyx_memoryview_slice_copy')
17866  */
17867  __pyx_r = __pyx_v_mslice;
17868  goto __pyx_L0;
17869  }
17870 
17871  /* "View.MemoryView":1052
17872  *
17873  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17874  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
17875  * __Pyx_memviewslice *mslice) except NULL:
17876  * cdef _memoryviewslice obj
17877  */
17878 
17879  /* function exit code */
17880  __pyx_L1_error:;
17881  __Pyx_XDECREF(__pyx_t_3);
17882  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
17883  __pyx_r = NULL;
17884  __pyx_L0:;
17885  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
17886  __Pyx_TraceReturn(Py_None, 0);
17887  __Pyx_RefNannyFinishContext();
17888  return __pyx_r;
17889 }
17890 
17891 /* "View.MemoryView":1063
17892  *
17893  * @cname('__pyx_memoryview_slice_copy')
17894  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
17895  * cdef int dim
17896  * cdef (Py_ssize_t*) shape, strides, suboffsets
17897  */
17898 
17899 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
17900  int __pyx_v_dim;
17901  Py_ssize_t *__pyx_v_shape;
17902  Py_ssize_t *__pyx_v_strides;
17903  Py_ssize_t *__pyx_v_suboffsets;
17904  __Pyx_TraceDeclarations
17905  __Pyx_RefNannyDeclarations
17906  Py_ssize_t *__pyx_t_1;
17907  int __pyx_t_2;
17908  int __pyx_t_3;
17909  int __pyx_t_4;
17910  Py_ssize_t __pyx_t_5;
17911  int __pyx_lineno = 0;
17912  const char *__pyx_filename = NULL;
17913  int __pyx_clineno = 0;
17914  __Pyx_RefNannySetupContext("slice_copy", 0);
17915  __Pyx_TraceCall("slice_copy", __pyx_f[1], 1063, 0, __PYX_ERR(1, 1063, __pyx_L1_error));
17916 
17917  /* "View.MemoryView":1067
17918  * cdef (Py_ssize_t*) shape, strides, suboffsets
17919  *
17920  * shape = memview.view.shape # <<<<<<<<<<<<<<
17921  * strides = memview.view.strides
17922  * suboffsets = memview.view.suboffsets
17923  */
17924  __pyx_t_1 = __pyx_v_memview->view.shape;
17925  __pyx_v_shape = __pyx_t_1;
17926 
17927  /* "View.MemoryView":1068
17928  *
17929  * shape = memview.view.shape
17930  * strides = memview.view.strides # <<<<<<<<<<<<<<
17931  * suboffsets = memview.view.suboffsets
17932  *
17933  */
17934  __pyx_t_1 = __pyx_v_memview->view.strides;
17935  __pyx_v_strides = __pyx_t_1;
17936 
17937  /* "View.MemoryView":1069
17938  * shape = memview.view.shape
17939  * strides = memview.view.strides
17940  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
17941  *
17942  * dst.memview = <__pyx_memoryview *> memview
17943  */
17944  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
17945  __pyx_v_suboffsets = __pyx_t_1;
17946 
17947  /* "View.MemoryView":1071
17948  * suboffsets = memview.view.suboffsets
17949  *
17950  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
17951  * dst.data = <char *> memview.view.buf
17952  *
17953  */
17954  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
17955 
17956  /* "View.MemoryView":1072
17957  *
17958  * dst.memview = <__pyx_memoryview *> memview
17959  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
17960  *
17961  * for dim in range(memview.view.ndim):
17962  */
17963  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
17964 
17965  /* "View.MemoryView":1074
17966  * dst.data = <char *> memview.view.buf
17967  *
17968  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
17969  * dst.shape[dim] = shape[dim]
17970  * dst.strides[dim] = strides[dim]
17971  */
17972  __pyx_t_2 = __pyx_v_memview->view.ndim;
17973  __pyx_t_3 = __pyx_t_2;
17974  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17975  __pyx_v_dim = __pyx_t_4;
17976 
17977  /* "View.MemoryView":1075
17978  *
17979  * for dim in range(memview.view.ndim):
17980  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
17981  * dst.strides[dim] = strides[dim]
17982  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
17983  */
17984  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
17985 
17986  /* "View.MemoryView":1076
17987  * for dim in range(memview.view.ndim):
17988  * dst.shape[dim] = shape[dim]
17989  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
17990  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
17991  *
17992  */
17993  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
17994 
17995  /* "View.MemoryView":1077
17996  * dst.shape[dim] = shape[dim]
17997  * dst.strides[dim] = strides[dim]
17998  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
17999  *
18000  * @cname('__pyx_memoryview_copy_object')
18001  */
18002  if ((__pyx_v_suboffsets != 0)) {
18003  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
18004  } else {
18005  __pyx_t_5 = -1L;
18006  }
18007  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
18008  }
18009 
18010  /* "View.MemoryView":1063
18011  *
18012  * @cname('__pyx_memoryview_slice_copy')
18013  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18014  * cdef int dim
18015  * cdef (Py_ssize_t*) shape, strides, suboffsets
18016  */
18017 
18018  /* function exit code */
18019  goto __pyx_L0;
18020  __pyx_L1_error:;
18021  __Pyx_WriteUnraisable("View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
18022  __pyx_L0:;
18023  __Pyx_TraceReturn(Py_None, 0);
18024  __Pyx_RefNannyFinishContext();
18025 }
18026 
18027 /* "View.MemoryView":1080
18028  *
18029  * @cname('__pyx_memoryview_copy_object')
18030  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18031  * "Create a new memoryview object"
18032  * cdef __Pyx_memviewslice memviewslice
18033  */
18034 
18035 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
18036  __Pyx_memviewslice __pyx_v_memviewslice;
18037  PyObject *__pyx_r = NULL;
18038  __Pyx_TraceDeclarations
18039  __Pyx_RefNannyDeclarations
18040  PyObject *__pyx_t_1 = NULL;
18041  int __pyx_lineno = 0;
18042  const char *__pyx_filename = NULL;
18043  int __pyx_clineno = 0;
18044  __Pyx_RefNannySetupContext("memoryview_copy", 0);
18045  __Pyx_TraceCall("memoryview_copy", __pyx_f[1], 1080, 0, __PYX_ERR(1, 1080, __pyx_L1_error));
18046 
18047  /* "View.MemoryView":1083
18048  * "Create a new memoryview object"
18049  * cdef __Pyx_memviewslice memviewslice
18050  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
18051  * return memoryview_copy_from_slice(memview, &memviewslice)
18052  *
18053  */
18054  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
18055 
18056  /* "View.MemoryView":1084
18057  * cdef __Pyx_memviewslice memviewslice
18058  * slice_copy(memview, &memviewslice)
18059  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
18060  *
18061  * @cname('__pyx_memoryview_copy_object_from_slice')
18062  */
18063  __Pyx_XDECREF(__pyx_r);
18064  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
18065  __Pyx_GOTREF(__pyx_t_1);
18066  __pyx_r = __pyx_t_1;
18067  __pyx_t_1 = 0;
18068  goto __pyx_L0;
18069 
18070  /* "View.MemoryView":1080
18071  *
18072  * @cname('__pyx_memoryview_copy_object')
18073  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18074  * "Create a new memoryview object"
18075  * cdef __Pyx_memviewslice memviewslice
18076  */
18077 
18078  /* function exit code */
18079  __pyx_L1_error:;
18080  __Pyx_XDECREF(__pyx_t_1);
18081  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18082  __pyx_r = 0;
18083  __pyx_L0:;
18084  __Pyx_XGIVEREF(__pyx_r);
18085  __Pyx_TraceReturn(__pyx_r, 0);
18086  __Pyx_RefNannyFinishContext();
18087  return __pyx_r;
18088 }
18089 
18090 /* "View.MemoryView":1087
18091  *
18092  * @cname('__pyx_memoryview_copy_object_from_slice')
18093  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18094  * """
18095  * Create a new memoryview object from a given memoryview object and slice.
18096  */
18097 
18098 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
18099  PyObject *(*__pyx_v_to_object_func)(char *);
18100  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
18101  PyObject *__pyx_r = NULL;
18102  __Pyx_TraceDeclarations
18103  __Pyx_RefNannyDeclarations
18104  int __pyx_t_1;
18105  int __pyx_t_2;
18106  PyObject *(*__pyx_t_3)(char *);
18107  int (*__pyx_t_4)(char *, PyObject *);
18108  PyObject *__pyx_t_5 = NULL;
18109  int __pyx_lineno = 0;
18110  const char *__pyx_filename = NULL;
18111  int __pyx_clineno = 0;
18112  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
18113  __Pyx_TraceCall("memoryview_copy_from_slice", __pyx_f[1], 1087, 0, __PYX_ERR(1, 1087, __pyx_L1_error));
18114 
18115  /* "View.MemoryView":1094
18116  * cdef int (*to_dtype_func)(char *, object) except 0
18117  *
18118  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18119  * to_object_func = (<_memoryviewslice> memview).to_object_func
18120  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18121  */
18122  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18123  __pyx_t_2 = (__pyx_t_1 != 0);
18124  if (__pyx_t_2) {
18125 
18126  /* "View.MemoryView":1095
18127  *
18128  * if isinstance(memview, _memoryviewslice):
18129  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
18130  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18131  * else:
18132  */
18133  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
18134  __pyx_v_to_object_func = __pyx_t_3;
18135 
18136  /* "View.MemoryView":1096
18137  * if isinstance(memview, _memoryviewslice):
18138  * to_object_func = (<_memoryviewslice> memview).to_object_func
18139  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
18140  * else:
18141  * to_object_func = NULL
18142  */
18143  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
18144  __pyx_v_to_dtype_func = __pyx_t_4;
18145 
18146  /* "View.MemoryView":1094
18147  * cdef int (*to_dtype_func)(char *, object) except 0
18148  *
18149  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18150  * to_object_func = (<_memoryviewslice> memview).to_object_func
18151  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18152  */
18153  goto __pyx_L3;
18154  }
18155 
18156  /* "View.MemoryView":1098
18157  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18158  * else:
18159  * to_object_func = NULL # <<<<<<<<<<<<<<
18160  * to_dtype_func = NULL
18161  *
18162  */
18163  /*else*/ {
18164  __pyx_v_to_object_func = NULL;
18165 
18166  /* "View.MemoryView":1099
18167  * else:
18168  * to_object_func = NULL
18169  * to_dtype_func = NULL # <<<<<<<<<<<<<<
18170  *
18171  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18172  */
18173  __pyx_v_to_dtype_func = NULL;
18174  }
18175  __pyx_L3:;
18176 
18177  /* "View.MemoryView":1101
18178  * to_dtype_func = NULL
18179  *
18180  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
18181  * to_object_func, to_dtype_func,
18182  * memview.dtype_is_object)
18183  */
18184  __Pyx_XDECREF(__pyx_r);
18185 
18186  /* "View.MemoryView":1103
18187  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18188  * to_object_func, to_dtype_func,
18189  * memview.dtype_is_object) # <<<<<<<<<<<<<<
18190  *
18191  *
18192  */
18193  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error)
18194  __Pyx_GOTREF(__pyx_t_5);
18195  __pyx_r = __pyx_t_5;
18196  __pyx_t_5 = 0;
18197  goto __pyx_L0;
18198 
18199  /* "View.MemoryView":1087
18200  *
18201  * @cname('__pyx_memoryview_copy_object_from_slice')
18202  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18203  * """
18204  * Create a new memoryview object from a given memoryview object and slice.
18205  */
18206 
18207  /* function exit code */
18208  __pyx_L1_error:;
18209  __Pyx_XDECREF(__pyx_t_5);
18210  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18211  __pyx_r = 0;
18212  __pyx_L0:;
18213  __Pyx_XGIVEREF(__pyx_r);
18214  __Pyx_TraceReturn(__pyx_r, 0);
18215  __Pyx_RefNannyFinishContext();
18216  return __pyx_r;
18217 }
18218 
18219 /* "View.MemoryView":1109
18220  *
18221  *
18222  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18223  * if arg < 0:
18224  * return -arg
18225  */
18226 
18227 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
18228  Py_ssize_t __pyx_r;
18229  __Pyx_TraceDeclarations
18230  int __pyx_t_1;
18231  int __pyx_lineno = 0;
18232  const char *__pyx_filename = NULL;
18233  int __pyx_clineno = 0;
18234  __Pyx_TraceCall("abs_py_ssize_t", __pyx_f[1], 1109, 1, __PYX_ERR(1, 1109, __pyx_L1_error));
18235 
18236  /* "View.MemoryView":1110
18237  *
18238  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18239  * if arg < 0: # <<<<<<<<<<<<<<
18240  * return -arg
18241  * else:
18242  */
18243  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
18244  if (__pyx_t_1) {
18245 
18246  /* "View.MemoryView":1111
18247  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18248  * if arg < 0:
18249  * return -arg # <<<<<<<<<<<<<<
18250  * else:
18251  * return arg
18252  */
18253  __pyx_r = (-__pyx_v_arg);
18254  goto __pyx_L0;
18255 
18256  /* "View.MemoryView":1110
18257  *
18258  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18259  * if arg < 0: # <<<<<<<<<<<<<<
18260  * return -arg
18261  * else:
18262  */
18263  }
18264 
18265  /* "View.MemoryView":1113
18266  * return -arg
18267  * else:
18268  * return arg # <<<<<<<<<<<<<<
18269  *
18270  * @cname('__pyx_get_best_slice_order')
18271  */
18272  /*else*/ {
18273  __pyx_r = __pyx_v_arg;
18274  goto __pyx_L0;
18275  }
18276 
18277  /* "View.MemoryView":1109
18278  *
18279  *
18280  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18281  * if arg < 0:
18282  * return -arg
18283  */
18284 
18285  /* function exit code */
18286  __pyx_L1_error:;
18287  __Pyx_WriteUnraisable("View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18288  __pyx_r = 0;
18289  __pyx_L0:;
18290  __Pyx_TraceReturn(Py_None, 1);
18291  return __pyx_r;
18292 }
18293 
18294 /* "View.MemoryView":1116
18295  *
18296  * @cname('__pyx_get_best_slice_order')
18297  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18298  * """
18299  * Figure out the best memory access order for a given slice.
18300  */
18301 
18302 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
18303  int __pyx_v_i;
18304  Py_ssize_t __pyx_v_c_stride;
18305  Py_ssize_t __pyx_v_f_stride;
18306  char __pyx_r;
18307  __Pyx_TraceDeclarations
18308  int __pyx_t_1;
18309  int __pyx_t_2;
18310  int __pyx_t_3;
18311  int __pyx_t_4;
18312  int __pyx_lineno = 0;
18313  const char *__pyx_filename = NULL;
18314  int __pyx_clineno = 0;
18315  __Pyx_TraceCall("get_best_order", __pyx_f[1], 1116, 1, __PYX_ERR(1, 1116, __pyx_L1_error));
18316 
18317  /* "View.MemoryView":1121
18318  * """
18319  * cdef int i
18320  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
18321  * cdef Py_ssize_t f_stride = 0
18322  *
18323  */
18324  __pyx_v_c_stride = 0;
18325 
18326  /* "View.MemoryView":1122
18327  * cdef int i
18328  * cdef Py_ssize_t c_stride = 0
18329  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
18330  *
18331  * for i in range(ndim - 1, -1, -1):
18332  */
18333  __pyx_v_f_stride = 0;
18334 
18335  /* "View.MemoryView":1124
18336  * cdef Py_ssize_t f_stride = 0
18337  *
18338  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18339  * if mslice.shape[i] > 1:
18340  * c_stride = mslice.strides[i]
18341  */
18342  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18343  __pyx_v_i = __pyx_t_1;
18344 
18345  /* "View.MemoryView":1125
18346  *
18347  * for i in range(ndim - 1, -1, -1):
18348  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18349  * c_stride = mslice.strides[i]
18350  * break
18351  */
18352  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18353  if (__pyx_t_2) {
18354 
18355  /* "View.MemoryView":1126
18356  * for i in range(ndim - 1, -1, -1):
18357  * if mslice.shape[i] > 1:
18358  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18359  * break
18360  *
18361  */
18362  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18363 
18364  /* "View.MemoryView":1127
18365  * if mslice.shape[i] > 1:
18366  * c_stride = mslice.strides[i]
18367  * break # <<<<<<<<<<<<<<
18368  *
18369  * for i in range(ndim):
18370  */
18371  goto __pyx_L4_break;
18372 
18373  /* "View.MemoryView":1125
18374  *
18375  * for i in range(ndim - 1, -1, -1):
18376  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18377  * c_stride = mslice.strides[i]
18378  * break
18379  */
18380  }
18381  }
18382  __pyx_L4_break:;
18383 
18384  /* "View.MemoryView":1129
18385  * break
18386  *
18387  * for i in range(ndim): # <<<<<<<<<<<<<<
18388  * if mslice.shape[i] > 1:
18389  * f_stride = mslice.strides[i]
18390  */
18391  __pyx_t_1 = __pyx_v_ndim;
18392  __pyx_t_3 = __pyx_t_1;
18393  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18394  __pyx_v_i = __pyx_t_4;
18395 
18396  /* "View.MemoryView":1130
18397  *
18398  * for i in range(ndim):
18399  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18400  * f_stride = mslice.strides[i]
18401  * break
18402  */
18403  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18404  if (__pyx_t_2) {
18405 
18406  /* "View.MemoryView":1131
18407  * for i in range(ndim):
18408  * if mslice.shape[i] > 1:
18409  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18410  * break
18411  *
18412  */
18413  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18414 
18415  /* "View.MemoryView":1132
18416  * if mslice.shape[i] > 1:
18417  * f_stride = mslice.strides[i]
18418  * break # <<<<<<<<<<<<<<
18419  *
18420  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18421  */
18422  goto __pyx_L7_break;
18423 
18424  /* "View.MemoryView":1130
18425  *
18426  * for i in range(ndim):
18427  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18428  * f_stride = mslice.strides[i]
18429  * break
18430  */
18431  }
18432  }
18433  __pyx_L7_break:;
18434 
18435  /* "View.MemoryView":1134
18436  * break
18437  *
18438  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18439  * return 'C'
18440  * else:
18441  */
18442  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18443  if (__pyx_t_2) {
18444 
18445  /* "View.MemoryView":1135
18446  *
18447  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18448  * return 'C' # <<<<<<<<<<<<<<
18449  * else:
18450  * return 'F'
18451  */
18452  __pyx_r = 'C';
18453  goto __pyx_L0;
18454 
18455  /* "View.MemoryView":1134
18456  * break
18457  *
18458  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18459  * return 'C'
18460  * else:
18461  */
18462  }
18463 
18464  /* "View.MemoryView":1137
18465  * return 'C'
18466  * else:
18467  * return 'F' # <<<<<<<<<<<<<<
18468  *
18469  * @cython.cdivision(True)
18470  */
18471  /*else*/ {
18472  __pyx_r = 'F';
18473  goto __pyx_L0;
18474  }
18475 
18476  /* "View.MemoryView":1116
18477  *
18478  * @cname('__pyx_get_best_slice_order')
18479  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18480  * """
18481  * Figure out the best memory access order for a given slice.
18482  */
18483 
18484  /* function exit code */
18485  __pyx_L1_error:;
18486  __Pyx_WriteUnraisable("View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18487  __pyx_r = 0;
18488  __pyx_L0:;
18489  __Pyx_TraceReturn(Py_None, 1);
18490  return __pyx_r;
18491 }
18492 
18493 /* "View.MemoryView":1140
18494  *
18495  * @cython.cdivision(True)
18496  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18497  * char *dst_data, Py_ssize_t *dst_strides,
18498  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18499  */
18500 
18501 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
18502  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18503  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18504  Py_ssize_t __pyx_v_dst_extent;
18505  Py_ssize_t __pyx_v_src_stride;
18506  Py_ssize_t __pyx_v_dst_stride;
18507  int __pyx_t_1;
18508  int __pyx_t_2;
18509  int __pyx_t_3;
18510  Py_ssize_t __pyx_t_4;
18511  Py_ssize_t __pyx_t_5;
18512  Py_ssize_t __pyx_t_6;
18513 
18514  /* "View.MemoryView":1147
18515  *
18516  * cdef Py_ssize_t i
18517  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
18518  * cdef Py_ssize_t dst_extent = dst_shape[0]
18519  * cdef Py_ssize_t src_stride = src_strides[0]
18520  */
18521  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18522 
18523  /* "View.MemoryView":1148
18524  * cdef Py_ssize_t i
18525  * cdef Py_ssize_t src_extent = src_shape[0]
18526  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
18527  * cdef Py_ssize_t src_stride = src_strides[0]
18528  * cdef Py_ssize_t dst_stride = dst_strides[0]
18529  */
18530  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18531 
18532  /* "View.MemoryView":1149
18533  * cdef Py_ssize_t src_extent = src_shape[0]
18534  * cdef Py_ssize_t dst_extent = dst_shape[0]
18535  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
18536  * cdef Py_ssize_t dst_stride = dst_strides[0]
18537  *
18538  */
18539  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18540 
18541  /* "View.MemoryView":1150
18542  * cdef Py_ssize_t dst_extent = dst_shape[0]
18543  * cdef Py_ssize_t src_stride = src_strides[0]
18544  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
18545  *
18546  * if ndim == 1:
18547  */
18548  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18549 
18550  /* "View.MemoryView":1152
18551  * cdef Py_ssize_t dst_stride = dst_strides[0]
18552  *
18553  * if ndim == 1: # <<<<<<<<<<<<<<
18554  * if (src_stride > 0 and dst_stride > 0 and
18555  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18556  */
18557  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18558  if (__pyx_t_1) {
18559 
18560  /* "View.MemoryView":1153
18561  *
18562  * if ndim == 1:
18563  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18564  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18565  * memcpy(dst_data, src_data, itemsize * dst_extent)
18566  */
18567  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18568  if (__pyx_t_2) {
18569  } else {
18570  __pyx_t_1 = __pyx_t_2;
18571  goto __pyx_L5_bool_binop_done;
18572  }
18573  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18574  if (__pyx_t_2) {
18575  } else {
18576  __pyx_t_1 = __pyx_t_2;
18577  goto __pyx_L5_bool_binop_done;
18578  }
18579 
18580  /* "View.MemoryView":1154
18581  * if ndim == 1:
18582  * if (src_stride > 0 and dst_stride > 0 and
18583  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
18584  * memcpy(dst_data, src_data, itemsize * dst_extent)
18585  * else:
18586  */
18587  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
18588  if (__pyx_t_2) {
18589  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
18590  }
18591  __pyx_t_3 = (__pyx_t_2 != 0);
18592  __pyx_t_1 = __pyx_t_3;
18593  __pyx_L5_bool_binop_done:;
18594 
18595  /* "View.MemoryView":1153
18596  *
18597  * if ndim == 1:
18598  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18599  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18600  * memcpy(dst_data, src_data, itemsize * dst_extent)
18601  */
18602  if (__pyx_t_1) {
18603 
18604  /* "View.MemoryView":1155
18605  * if (src_stride > 0 and dst_stride > 0 and
18606  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18607  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
18608  * else:
18609  * for i in range(dst_extent):
18610  */
18611  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
18612 
18613  /* "View.MemoryView":1153
18614  *
18615  * if ndim == 1:
18616  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18617  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18618  * memcpy(dst_data, src_data, itemsize * dst_extent)
18619  */
18620  goto __pyx_L4;
18621  }
18622 
18623  /* "View.MemoryView":1157
18624  * memcpy(dst_data, src_data, itemsize * dst_extent)
18625  * else:
18626  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18627  * memcpy(dst_data, src_data, itemsize)
18628  * src_data += src_stride
18629  */
18630  /*else*/ {
18631  __pyx_t_4 = __pyx_v_dst_extent;
18632  __pyx_t_5 = __pyx_t_4;
18633  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18634  __pyx_v_i = __pyx_t_6;
18635 
18636  /* "View.MemoryView":1158
18637  * else:
18638  * for i in range(dst_extent):
18639  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
18640  * src_data += src_stride
18641  * dst_data += dst_stride
18642  */
18643  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
18644 
18645  /* "View.MemoryView":1159
18646  * for i in range(dst_extent):
18647  * memcpy(dst_data, src_data, itemsize)
18648  * src_data += src_stride # <<<<<<<<<<<<<<
18649  * dst_data += dst_stride
18650  * else:
18651  */
18652  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18653 
18654  /* "View.MemoryView":1160
18655  * memcpy(dst_data, src_data, itemsize)
18656  * src_data += src_stride
18657  * dst_data += dst_stride # <<<<<<<<<<<<<<
18658  * else:
18659  * for i in range(dst_extent):
18660  */
18661  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18662  }
18663  }
18664  __pyx_L4:;
18665 
18666  /* "View.MemoryView":1152
18667  * cdef Py_ssize_t dst_stride = dst_strides[0]
18668  *
18669  * if ndim == 1: # <<<<<<<<<<<<<<
18670  * if (src_stride > 0 and dst_stride > 0 and
18671  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18672  */
18673  goto __pyx_L3;
18674  }
18675 
18676  /* "View.MemoryView":1162
18677  * dst_data += dst_stride
18678  * else:
18679  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18680  * _copy_strided_to_strided(src_data, src_strides + 1,
18681  * dst_data, dst_strides + 1,
18682  */
18683  /*else*/ {
18684  __pyx_t_4 = __pyx_v_dst_extent;
18685  __pyx_t_5 = __pyx_t_4;
18686  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18687  __pyx_v_i = __pyx_t_6;
18688 
18689  /* "View.MemoryView":1163
18690  * else:
18691  * for i in range(dst_extent):
18692  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
18693  * dst_data, dst_strides + 1,
18694  * src_shape + 1, dst_shape + 1,
18695  */
18696  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
18697 
18698  /* "View.MemoryView":1167
18699  * src_shape + 1, dst_shape + 1,
18700  * ndim - 1, itemsize)
18701  * src_data += src_stride # <<<<<<<<<<<<<<
18702  * dst_data += dst_stride
18703  *
18704  */
18705  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18706 
18707  /* "View.MemoryView":1168
18708  * ndim - 1, itemsize)
18709  * src_data += src_stride
18710  * dst_data += dst_stride # <<<<<<<<<<<<<<
18711  *
18712  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
18713  */
18714  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18715  }
18716  }
18717  __pyx_L3:;
18718 
18719  /* "View.MemoryView":1140
18720  *
18721  * @cython.cdivision(True)
18722  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18723  * char *dst_data, Py_ssize_t *dst_strides,
18724  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18725  */
18726 
18727  /* function exit code */
18728 }
18729 
18730 /* "View.MemoryView":1170
18731  * dst_data += dst_stride
18732  *
18733  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18734  * __Pyx_memviewslice *dst,
18735  * int ndim, size_t itemsize) nogil:
18736  */
18737 
18738 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
18739  __Pyx_TraceDeclarations
18740  int __pyx_lineno = 0;
18741  const char *__pyx_filename = NULL;
18742  int __pyx_clineno = 0;
18743  __Pyx_TraceCall("copy_strided_to_strided", __pyx_f[1], 1170, 1, __PYX_ERR(1, 1170, __pyx_L1_error));
18744 
18745  /* "View.MemoryView":1173
18746  * __Pyx_memviewslice *dst,
18747  * int ndim, size_t itemsize) nogil:
18748  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
18749  * src.shape, dst.shape, ndim, itemsize)
18750  *
18751  */
18752  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
18753 
18754  /* "View.MemoryView":1170
18755  * dst_data += dst_stride
18756  *
18757  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18758  * __Pyx_memviewslice *dst,
18759  * int ndim, size_t itemsize) nogil:
18760  */
18761 
18762  /* function exit code */
18763  goto __pyx_L0;
18764  __pyx_L1_error:;
18765  __Pyx_WriteUnraisable("View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18766  __pyx_L0:;
18767  __Pyx_TraceReturn(Py_None, 1);
18768 }
18769 
18770 /* "View.MemoryView":1177
18771  *
18772  * @cname('__pyx_memoryview_slice_get_size')
18773  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
18774  * "Return the size of the memory occupied by the slice in number of bytes"
18775  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18776  */
18777 
18778 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
18779  Py_ssize_t __pyx_v_shape;
18780  Py_ssize_t __pyx_v_size;
18781  Py_ssize_t __pyx_r;
18782  __Pyx_TraceDeclarations
18783  Py_ssize_t __pyx_t_1;
18784  Py_ssize_t *__pyx_t_2;
18785  Py_ssize_t *__pyx_t_3;
18786  Py_ssize_t *__pyx_t_4;
18787  int __pyx_lineno = 0;
18788  const char *__pyx_filename = NULL;
18789  int __pyx_clineno = 0;
18790  __Pyx_TraceCall("slice_get_size", __pyx_f[1], 1177, 1, __PYX_ERR(1, 1177, __pyx_L1_error));
18791 
18792  /* "View.MemoryView":1179
18793  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
18794  * "Return the size of the memory occupied by the slice in number of bytes"
18795  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
18796  *
18797  * for shape in src.shape[:ndim]:
18798  */
18799  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18800  __pyx_v_size = __pyx_t_1;
18801 
18802  /* "View.MemoryView":1181
18803  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18804  *
18805  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
18806  * size *= shape
18807  *
18808  */
18809  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
18810  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
18811  __pyx_t_2 = __pyx_t_4;
18812  __pyx_v_shape = (__pyx_t_2[0]);
18813 
18814  /* "View.MemoryView":1182
18815  *
18816  * for shape in src.shape[:ndim]:
18817  * size *= shape # <<<<<<<<<<<<<<
18818  *
18819  * return size
18820  */
18821  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
18822  }
18823 
18824  /* "View.MemoryView":1184
18825  * size *= shape
18826  *
18827  * return size # <<<<<<<<<<<<<<
18828  *
18829  * @cname('__pyx_fill_contig_strides_array')
18830  */
18831  __pyx_r = __pyx_v_size;
18832  goto __pyx_L0;
18833 
18834  /* "View.MemoryView":1177
18835  *
18836  * @cname('__pyx_memoryview_slice_get_size')
18837  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
18838  * "Return the size of the memory occupied by the slice in number of bytes"
18839  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18840  */
18841 
18842  /* function exit code */
18843  __pyx_L1_error:;
18844  __Pyx_WriteUnraisable("View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18845  __pyx_r = 0;
18846  __pyx_L0:;
18847  __Pyx_TraceReturn(Py_None, 1);
18848  return __pyx_r;
18849 }
18850 
18851 /* "View.MemoryView":1187
18852  *
18853  * @cname('__pyx_fill_contig_strides_array')
18854  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
18855  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
18856  * int ndim, char order) nogil:
18857  */
18858 
18859 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
18860  int __pyx_v_idx;
18861  Py_ssize_t __pyx_r;
18862  __Pyx_TraceDeclarations
18863  int __pyx_t_1;
18864  int __pyx_t_2;
18865  int __pyx_t_3;
18866  int __pyx_t_4;
18867  int __pyx_lineno = 0;
18868  const char *__pyx_filename = NULL;
18869  int __pyx_clineno = 0;
18870  __Pyx_TraceCall("fill_contig_strides_array", __pyx_f[1], 1187, 1, __PYX_ERR(1, 1187, __pyx_L1_error));
18871 
18872  /* "View.MemoryView":1196
18873  * cdef int idx
18874  *
18875  * if order == 'F': # <<<<<<<<<<<<<<
18876  * for idx in range(ndim):
18877  * strides[idx] = stride
18878  */
18879  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
18880  if (__pyx_t_1) {
18881 
18882  /* "View.MemoryView":1197
18883  *
18884  * if order == 'F':
18885  * for idx in range(ndim): # <<<<<<<<<<<<<<
18886  * strides[idx] = stride
18887  * stride *= shape[idx]
18888  */
18889  __pyx_t_2 = __pyx_v_ndim;
18890  __pyx_t_3 = __pyx_t_2;
18891  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18892  __pyx_v_idx = __pyx_t_4;
18893 
18894  /* "View.MemoryView":1198
18895  * if order == 'F':
18896  * for idx in range(ndim):
18897  * strides[idx] = stride # <<<<<<<<<<<<<<
18898  * stride *= shape[idx]
18899  * else:
18900  */
18901  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18902 
18903  /* "View.MemoryView":1199
18904  * for idx in range(ndim):
18905  * strides[idx] = stride
18906  * stride *= shape[idx] # <<<<<<<<<<<<<<
18907  * else:
18908  * for idx in range(ndim - 1, -1, -1):
18909  */
18910  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18911  }
18912 
18913  /* "View.MemoryView":1196
18914  * cdef int idx
18915  *
18916  * if order == 'F': # <<<<<<<<<<<<<<
18917  * for idx in range(ndim):
18918  * strides[idx] = stride
18919  */
18920  goto __pyx_L3;
18921  }
18922 
18923  /* "View.MemoryView":1201
18924  * stride *= shape[idx]
18925  * else:
18926  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18927  * strides[idx] = stride
18928  * stride *= shape[idx]
18929  */
18930  /*else*/ {
18931  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
18932  __pyx_v_idx = __pyx_t_2;
18933 
18934  /* "View.MemoryView":1202
18935  * else:
18936  * for idx in range(ndim - 1, -1, -1):
18937  * strides[idx] = stride # <<<<<<<<<<<<<<
18938  * stride *= shape[idx]
18939  *
18940  */
18941  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18942 
18943  /* "View.MemoryView":1203
18944  * for idx in range(ndim - 1, -1, -1):
18945  * strides[idx] = stride
18946  * stride *= shape[idx] # <<<<<<<<<<<<<<
18947  *
18948  * return stride
18949  */
18950  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18951  }
18952  }
18953  __pyx_L3:;
18954 
18955  /* "View.MemoryView":1205
18956  * stride *= shape[idx]
18957  *
18958  * return stride # <<<<<<<<<<<<<<
18959  *
18960  * @cname('__pyx_memoryview_copy_data_to_temp')
18961  */
18962  __pyx_r = __pyx_v_stride;
18963  goto __pyx_L0;
18964 
18965  /* "View.MemoryView":1187
18966  *
18967  * @cname('__pyx_fill_contig_strides_array')
18968  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
18969  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
18970  * int ndim, char order) nogil:
18971  */
18972 
18973  /* function exit code */
18974  __pyx_L1_error:;
18975  __Pyx_WriteUnraisable("View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18976  __pyx_r = 0;
18977  __pyx_L0:;
18978  __Pyx_TraceReturn(Py_None, 1);
18979  return __pyx_r;
18980 }
18981 
18982 /* "View.MemoryView":1208
18983  *
18984  * @cname('__pyx_memoryview_copy_data_to_temp')
18985  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18986  * __Pyx_memviewslice *tmpslice,
18987  * char order,
18988  */
18989 
18990 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
18991  int __pyx_v_i;
18992  void *__pyx_v_result;
18993  size_t __pyx_v_itemsize;
18994  size_t __pyx_v_size;
18995  void *__pyx_r;
18996  __Pyx_TraceDeclarations
18997  Py_ssize_t __pyx_t_1;
18998  int __pyx_t_2;
18999  int __pyx_t_3;
19000  struct __pyx_memoryview_obj *__pyx_t_4;
19001  int __pyx_t_5;
19002  int __pyx_t_6;
19003  int __pyx_lineno = 0;
19004  const char *__pyx_filename = NULL;
19005  int __pyx_clineno = 0;
19006  __Pyx_TraceCall("copy_data_to_temp", __pyx_f[1], 1208, 1, __PYX_ERR(1, 1208, __pyx_L1_error));
19007 
19008  /* "View.MemoryView":1219
19009  * cdef void *result
19010  *
19011  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19012  * cdef size_t size = slice_get_size(src, ndim)
19013  *
19014  */
19015  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19016  __pyx_v_itemsize = __pyx_t_1;
19017 
19018  /* "View.MemoryView":1220
19019  *
19020  * cdef size_t itemsize = src.memview.view.itemsize
19021  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
19022  *
19023  * result = malloc(size)
19024  */
19025  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
19026 
19027  /* "View.MemoryView":1222
19028  * cdef size_t size = slice_get_size(src, ndim)
19029  *
19030  * result = malloc(size) # <<<<<<<<<<<<<<
19031  * if not result:
19032  * _err(MemoryError, NULL)
19033  */
19034  __pyx_v_result = malloc(__pyx_v_size);
19035 
19036  /* "View.MemoryView":1223
19037  *
19038  * result = malloc(size)
19039  * if not result: # <<<<<<<<<<<<<<
19040  * _err(MemoryError, NULL)
19041  *
19042  */
19043  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
19044  if (__pyx_t_2) {
19045 
19046  /* "View.MemoryView":1224
19047  * result = malloc(size)
19048  * if not result:
19049  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
19050  *
19051  *
19052  */
19053  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
19054 
19055  /* "View.MemoryView":1223
19056  *
19057  * result = malloc(size)
19058  * if not result: # <<<<<<<<<<<<<<
19059  * _err(MemoryError, NULL)
19060  *
19061  */
19062  }
19063 
19064  /* "View.MemoryView":1227
19065  *
19066  *
19067  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
19068  * tmpslice.memview = src.memview
19069  * for i in range(ndim):
19070  */
19071  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
19072 
19073  /* "View.MemoryView":1228
19074  *
19075  * tmpslice.data = <char *> result
19076  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
19077  * for i in range(ndim):
19078  * tmpslice.shape[i] = src.shape[i]
19079  */
19080  __pyx_t_4 = __pyx_v_src->memview;
19081  __pyx_v_tmpslice->memview = __pyx_t_4;
19082 
19083  /* "View.MemoryView":1229
19084  * tmpslice.data = <char *> result
19085  * tmpslice.memview = src.memview
19086  * for i in range(ndim): # <<<<<<<<<<<<<<
19087  * tmpslice.shape[i] = src.shape[i]
19088  * tmpslice.suboffsets[i] = -1
19089  */
19090  __pyx_t_3 = __pyx_v_ndim;
19091  __pyx_t_5 = __pyx_t_3;
19092  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19093  __pyx_v_i = __pyx_t_6;
19094 
19095  /* "View.MemoryView":1230
19096  * tmpslice.memview = src.memview
19097  * for i in range(ndim):
19098  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
19099  * tmpslice.suboffsets[i] = -1
19100  *
19101  */
19102  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
19103 
19104  /* "View.MemoryView":1231
19105  * for i in range(ndim):
19106  * tmpslice.shape[i] = src.shape[i]
19107  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
19108  *
19109  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
19110  */
19111  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
19112  }
19113 
19114  /* "View.MemoryView":1233
19115  * tmpslice.suboffsets[i] = -1
19116  *
19117  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
19118  * ndim, order)
19119  *
19120  */
19121  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
19122 
19123  /* "View.MemoryView":1237
19124  *
19125  *
19126  * for i in range(ndim): # <<<<<<<<<<<<<<
19127  * if tmpslice.shape[i] == 1:
19128  * tmpslice.strides[i] = 0
19129  */
19130  __pyx_t_3 = __pyx_v_ndim;
19131  __pyx_t_5 = __pyx_t_3;
19132  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19133  __pyx_v_i = __pyx_t_6;
19134 
19135  /* "View.MemoryView":1238
19136  *
19137  * for i in range(ndim):
19138  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19139  * tmpslice.strides[i] = 0
19140  *
19141  */
19142  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19143  if (__pyx_t_2) {
19144 
19145  /* "View.MemoryView":1239
19146  * for i in range(ndim):
19147  * if tmpslice.shape[i] == 1:
19148  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
19149  *
19150  * if slice_is_contig(src[0], order, ndim):
19151  */
19152  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19153 
19154  /* "View.MemoryView":1238
19155  *
19156  * for i in range(ndim):
19157  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19158  * tmpslice.strides[i] = 0
19159  *
19160  */
19161  }
19162  }
19163 
19164  /* "View.MemoryView":1241
19165  * tmpslice.strides[i] = 0
19166  *
19167  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19168  * memcpy(result, src.data, size)
19169  * else:
19170  */
19171  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19172  if (__pyx_t_2) {
19173 
19174  /* "View.MemoryView":1242
19175  *
19176  * if slice_is_contig(src[0], order, ndim):
19177  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
19178  * else:
19179  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19180  */
19181  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19182 
19183  /* "View.MemoryView":1241
19184  * tmpslice.strides[i] = 0
19185  *
19186  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19187  * memcpy(result, src.data, size)
19188  * else:
19189  */
19190  goto __pyx_L9;
19191  }
19192 
19193  /* "View.MemoryView":1244
19194  * memcpy(result, src.data, size)
19195  * else:
19196  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
19197  *
19198  * return result
19199  */
19200  /*else*/ {
19201  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19202  }
19203  __pyx_L9:;
19204 
19205  /* "View.MemoryView":1246
19206  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19207  *
19208  * return result # <<<<<<<<<<<<<<
19209  *
19210  *
19211  */
19212  __pyx_r = __pyx_v_result;
19213  goto __pyx_L0;
19214 
19215  /* "View.MemoryView":1208
19216  *
19217  * @cname('__pyx_memoryview_copy_data_to_temp')
19218  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19219  * __Pyx_memviewslice *tmpslice,
19220  * char order,
19221  */
19222 
19223  /* function exit code */
19224  __pyx_L1_error:;
19225  {
19226  #ifdef WITH_THREAD
19227  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19228  #endif
19229  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19230  #ifdef WITH_THREAD
19231  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19232  #endif
19233  }
19234  __pyx_r = NULL;
19235  __pyx_L0:;
19236  __Pyx_TraceReturn(Py_None, 1);
19237  return __pyx_r;
19238 }
19239 
19240 /* "View.MemoryView":1251
19241  *
19242  * @cname('__pyx_memoryview_err_extents')
19243  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19244  * Py_ssize_t extent2) except -1 with gil:
19245  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19246  */
19247 
19248 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
19249  int __pyx_r;
19250  __Pyx_TraceDeclarations
19251  __Pyx_RefNannyDeclarations
19252  PyObject *__pyx_t_1 = NULL;
19253  PyObject *__pyx_t_2 = NULL;
19254  PyObject *__pyx_t_3 = NULL;
19255  PyObject *__pyx_t_4 = NULL;
19256  int __pyx_lineno = 0;
19257  const char *__pyx_filename = NULL;
19258  int __pyx_clineno = 0;
19259  #ifdef WITH_THREAD
19260  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19261  #endif
19262  __Pyx_RefNannySetupContext("_err_extents", 0);
19263  __Pyx_TraceCall("_err_extents", __pyx_f[1], 1251, 0, __PYX_ERR(1, 1251, __pyx_L1_error));
19264 
19265  /* "View.MemoryView":1254
19266  * Py_ssize_t extent2) except -1 with gil:
19267  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19268  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
19269  *
19270  * @cname('__pyx_memoryview_err_dim')
19271  */
19272  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19273  __Pyx_GOTREF(__pyx_t_1);
19274  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
19275  __Pyx_GOTREF(__pyx_t_2);
19276  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
19277  __Pyx_GOTREF(__pyx_t_3);
19278  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
19279  __Pyx_GOTREF(__pyx_t_4);
19280  __Pyx_GIVEREF(__pyx_t_1);
19281  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
19282  __Pyx_GIVEREF(__pyx_t_2);
19283  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
19284  __Pyx_GIVEREF(__pyx_t_3);
19285  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
19286  __pyx_t_1 = 0;
19287  __pyx_t_2 = 0;
19288  __pyx_t_3 = 0;
19289 
19290  /* "View.MemoryView":1253
19291  * cdef int _err_extents(int i, Py_ssize_t extent1,
19292  * Py_ssize_t extent2) except -1 with gil:
19293  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
19294  * (i, extent1, extent2))
19295  *
19296  */
19297  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
19298  __Pyx_GOTREF(__pyx_t_3);
19299  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19300  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
19301  __Pyx_GOTREF(__pyx_t_4);
19302  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19303  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19304  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19305  __PYX_ERR(1, 1253, __pyx_L1_error)
19306 
19307  /* "View.MemoryView":1251
19308  *
19309  * @cname('__pyx_memoryview_err_extents')
19310  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19311  * Py_ssize_t extent2) except -1 with gil:
19312  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19313  */
19314 
19315  /* function exit code */
19316  __pyx_L1_error:;
19317  __Pyx_XDECREF(__pyx_t_1);
19318  __Pyx_XDECREF(__pyx_t_2);
19319  __Pyx_XDECREF(__pyx_t_3);
19320  __Pyx_XDECREF(__pyx_t_4);
19321  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19322  __pyx_r = -1;
19323  __Pyx_TraceReturn(Py_None, 0);
19324  __Pyx_RefNannyFinishContext();
19325  #ifdef WITH_THREAD
19326  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19327  #endif
19328  return __pyx_r;
19329 }
19330 
19331 /* "View.MemoryView":1257
19332  *
19333  * @cname('__pyx_memoryview_err_dim')
19334  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19335  * raise error(msg.decode('ascii') % dim)
19336  *
19337  */
19338 
19339 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
19340  int __pyx_r;
19341  __Pyx_TraceDeclarations
19342  __Pyx_RefNannyDeclarations
19343  PyObject *__pyx_t_1 = NULL;
19344  PyObject *__pyx_t_2 = NULL;
19345  PyObject *__pyx_t_3 = NULL;
19346  PyObject *__pyx_t_4 = NULL;
19347  int __pyx_lineno = 0;
19348  const char *__pyx_filename = NULL;
19349  int __pyx_clineno = 0;
19350  #ifdef WITH_THREAD
19351  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19352  #endif
19353  __Pyx_RefNannySetupContext("_err_dim", 0);
19354  __Pyx_TraceCall("_err_dim", __pyx_f[1], 1257, 0, __PYX_ERR(1, 1257, __pyx_L1_error));
19355  __Pyx_INCREF(__pyx_v_error);
19356 
19357  /* "View.MemoryView":1258
19358  * @cname('__pyx_memoryview_err_dim')
19359  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
19360  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
19361  *
19362  * @cname('__pyx_memoryview_err')
19363  */
19364  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
19365  __Pyx_GOTREF(__pyx_t_2);
19366  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
19367  __Pyx_GOTREF(__pyx_t_3);
19368  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
19369  __Pyx_GOTREF(__pyx_t_4);
19370  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19371  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19372  __Pyx_INCREF(__pyx_v_error);
19373  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19374  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19375  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19376  if (likely(__pyx_t_2)) {
19377  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
19378  __Pyx_INCREF(__pyx_t_2);
19379  __Pyx_INCREF(function);
19380  __Pyx_DECREF_SET(__pyx_t_3, function);
19381  }
19382  }
19383  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
19384  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19385  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19386  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
19387  __Pyx_GOTREF(__pyx_t_1);
19388  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19389  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19390  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19391  __PYX_ERR(1, 1258, __pyx_L1_error)
19392 
19393  /* "View.MemoryView":1257
19394  *
19395  * @cname('__pyx_memoryview_err_dim')
19396  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19397  * raise error(msg.decode('ascii') % dim)
19398  *
19399  */
19400 
19401  /* function exit code */
19402  __pyx_L1_error:;
19403  __Pyx_XDECREF(__pyx_t_1);
19404  __Pyx_XDECREF(__pyx_t_2);
19405  __Pyx_XDECREF(__pyx_t_3);
19406  __Pyx_XDECREF(__pyx_t_4);
19407  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19408  __pyx_r = -1;
19409  __Pyx_XDECREF(__pyx_v_error);
19410  __Pyx_TraceReturn(Py_None, 0);
19411  __Pyx_RefNannyFinishContext();
19412  #ifdef WITH_THREAD
19413  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19414  #endif
19415  return __pyx_r;
19416 }
19417 
19418 /* "View.MemoryView":1261
19419  *
19420  * @cname('__pyx_memoryview_err')
19421  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19422  * if msg != NULL:
19423  * raise error(msg.decode('ascii'))
19424  */
19425 
19426 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
19427  int __pyx_r;
19428  __Pyx_TraceDeclarations
19429  __Pyx_RefNannyDeclarations
19430  int __pyx_t_1;
19431  PyObject *__pyx_t_2 = NULL;
19432  PyObject *__pyx_t_3 = NULL;
19433  PyObject *__pyx_t_4 = NULL;
19434  PyObject *__pyx_t_5 = NULL;
19435  int __pyx_lineno = 0;
19436  const char *__pyx_filename = NULL;
19437  int __pyx_clineno = 0;
19438  #ifdef WITH_THREAD
19439  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19440  #endif
19441  __Pyx_RefNannySetupContext("_err", 0);
19442  __Pyx_TraceCall("_err", __pyx_f[1], 1261, 0, __PYX_ERR(1, 1261, __pyx_L1_error));
19443  __Pyx_INCREF(__pyx_v_error);
19444 
19445  /* "View.MemoryView":1262
19446  * @cname('__pyx_memoryview_err')
19447  * cdef int _err(object error, char *msg) except -1 with gil:
19448  * if msg != NULL: # <<<<<<<<<<<<<<
19449  * raise error(msg.decode('ascii'))
19450  * else:
19451  */
19452  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19453  if (unlikely(__pyx_t_1)) {
19454 
19455  /* "View.MemoryView":1263
19456  * cdef int _err(object error, char *msg) except -1 with gil:
19457  * if msg != NULL:
19458  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
19459  * else:
19460  * raise error
19461  */
19462  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
19463  __Pyx_GOTREF(__pyx_t_3);
19464  __Pyx_INCREF(__pyx_v_error);
19465  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19466  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19467  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19468  if (likely(__pyx_t_5)) {
19469  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
19470  __Pyx_INCREF(__pyx_t_5);
19471  __Pyx_INCREF(function);
19472  __Pyx_DECREF_SET(__pyx_t_4, function);
19473  }
19474  }
19475  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
19476  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19477  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19478  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
19479  __Pyx_GOTREF(__pyx_t_2);
19480  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19481  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19482  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19483  __PYX_ERR(1, 1263, __pyx_L1_error)
19484 
19485  /* "View.MemoryView":1262
19486  * @cname('__pyx_memoryview_err')
19487  * cdef int _err(object error, char *msg) except -1 with gil:
19488  * if msg != NULL: # <<<<<<<<<<<<<<
19489  * raise error(msg.decode('ascii'))
19490  * else:
19491  */
19492  }
19493 
19494  /* "View.MemoryView":1265
19495  * raise error(msg.decode('ascii'))
19496  * else:
19497  * raise error # <<<<<<<<<<<<<<
19498  *
19499  * @cname('__pyx_memoryview_copy_contents')
19500  */
19501  /*else*/ {
19502  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19503  __PYX_ERR(1, 1265, __pyx_L1_error)
19504  }
19505 
19506  /* "View.MemoryView":1261
19507  *
19508  * @cname('__pyx_memoryview_err')
19509  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19510  * if msg != NULL:
19511  * raise error(msg.decode('ascii'))
19512  */
19513 
19514  /* function exit code */
19515  __pyx_L1_error:;
19516  __Pyx_XDECREF(__pyx_t_2);
19517  __Pyx_XDECREF(__pyx_t_3);
19518  __Pyx_XDECREF(__pyx_t_4);
19519  __Pyx_XDECREF(__pyx_t_5);
19520  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19521  __pyx_r = -1;
19522  __Pyx_XDECREF(__pyx_v_error);
19523  __Pyx_TraceReturn(Py_None, 0);
19524  __Pyx_RefNannyFinishContext();
19525  #ifdef WITH_THREAD
19526  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19527  #endif
19528  return __pyx_r;
19529 }
19530 
19531 /* "View.MemoryView":1268
19532  *
19533  * @cname('__pyx_memoryview_copy_contents')
19534  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
19535  * __Pyx_memviewslice dst,
19536  * int src_ndim, int dst_ndim,
19537  */
19538 
19539 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
19540  void *__pyx_v_tmpdata;
19541  size_t __pyx_v_itemsize;
19542  int __pyx_v_i;
19543  char __pyx_v_order;
19544  int __pyx_v_broadcasting;
19545  int __pyx_v_direct_copy;
19546  __Pyx_memviewslice __pyx_v_tmp;
19547  int __pyx_v_ndim;
19548  int __pyx_r;
19549  __Pyx_TraceDeclarations
19550  Py_ssize_t __pyx_t_1;
19551  int __pyx_t_2;
19552  int __pyx_t_3;
19553  int __pyx_t_4;
19554  int __pyx_t_5;
19555  int __pyx_t_6;
19556  void *__pyx_t_7;
19557  int __pyx_t_8;
19558  int __pyx_lineno = 0;
19559  const char *__pyx_filename = NULL;
19560  int __pyx_clineno = 0;
19561  __Pyx_TraceCall("memoryview_copy_contents", __pyx_f[1], 1268, 1, __PYX_ERR(1, 1268, __pyx_L1_error));
19562 
19563  /* "View.MemoryView":1276
19564  * Check for overlapping memory and verify the shapes.
19565  * """
19566  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
19567  * cdef size_t itemsize = src.memview.view.itemsize
19568  * cdef int i
19569  */
19570  __pyx_v_tmpdata = NULL;
19571 
19572  /* "View.MemoryView":1277
19573  * """
19574  * cdef void *tmpdata = NULL
19575  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19576  * cdef int i
19577  * cdef char order = get_best_order(&src, src_ndim)
19578  */
19579  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19580  __pyx_v_itemsize = __pyx_t_1;
19581 
19582  /* "View.MemoryView":1279
19583  * cdef size_t itemsize = src.memview.view.itemsize
19584  * cdef int i
19585  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
19586  * cdef bint broadcasting = False
19587  * cdef bint direct_copy = False
19588  */
19589  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19590 
19591  /* "View.MemoryView":1280
19592  * cdef int i
19593  * cdef char order = get_best_order(&src, src_ndim)
19594  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
19595  * cdef bint direct_copy = False
19596  * cdef __Pyx_memviewslice tmp
19597  */
19598  __pyx_v_broadcasting = 0;
19599 
19600  /* "View.MemoryView":1281
19601  * cdef char order = get_best_order(&src, src_ndim)
19602  * cdef bint broadcasting = False
19603  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
19604  * cdef __Pyx_memviewslice tmp
19605  *
19606  */
19607  __pyx_v_direct_copy = 0;
19608 
19609  /* "View.MemoryView":1284
19610  * cdef __Pyx_memviewslice tmp
19611  *
19612  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19613  * broadcast_leading(&src, src_ndim, dst_ndim)
19614  * elif dst_ndim < src_ndim:
19615  */
19616  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19617  if (__pyx_t_2) {
19618 
19619  /* "View.MemoryView":1285
19620  *
19621  * if src_ndim < dst_ndim:
19622  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19623  * elif dst_ndim < src_ndim:
19624  * broadcast_leading(&dst, dst_ndim, src_ndim)
19625  */
19626  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
19627 
19628  /* "View.MemoryView":1284
19629  * cdef __Pyx_memviewslice tmp
19630  *
19631  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19632  * broadcast_leading(&src, src_ndim, dst_ndim)
19633  * elif dst_ndim < src_ndim:
19634  */
19635  goto __pyx_L3;
19636  }
19637 
19638  /* "View.MemoryView":1286
19639  * if src_ndim < dst_ndim:
19640  * broadcast_leading(&src, src_ndim, dst_ndim)
19641  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19642  * broadcast_leading(&dst, dst_ndim, src_ndim)
19643  *
19644  */
19645  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
19646  if (__pyx_t_2) {
19647 
19648  /* "View.MemoryView":1287
19649  * broadcast_leading(&src, src_ndim, dst_ndim)
19650  * elif dst_ndim < src_ndim:
19651  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
19652  *
19653  * cdef int ndim = max(src_ndim, dst_ndim)
19654  */
19655  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
19656 
19657  /* "View.MemoryView":1286
19658  * if src_ndim < dst_ndim:
19659  * broadcast_leading(&src, src_ndim, dst_ndim)
19660  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19661  * broadcast_leading(&dst, dst_ndim, src_ndim)
19662  *
19663  */
19664  }
19665  __pyx_L3:;
19666 
19667  /* "View.MemoryView":1289
19668  * broadcast_leading(&dst, dst_ndim, src_ndim)
19669  *
19670  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19671  *
19672  * for i in range(ndim):
19673  */
19674  __pyx_t_3 = __pyx_v_dst_ndim;
19675  __pyx_t_4 = __pyx_v_src_ndim;
19676  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
19677  __pyx_t_5 = __pyx_t_3;
19678  } else {
19679  __pyx_t_5 = __pyx_t_4;
19680  }
19681  __pyx_v_ndim = __pyx_t_5;
19682 
19683  /* "View.MemoryView":1291
19684  * cdef int ndim = max(src_ndim, dst_ndim)
19685  *
19686  * for i in range(ndim): # <<<<<<<<<<<<<<
19687  * if src.shape[i] != dst.shape[i]:
19688  * if src.shape[i] == 1:
19689  */
19690  __pyx_t_5 = __pyx_v_ndim;
19691  __pyx_t_3 = __pyx_t_5;
19692  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19693  __pyx_v_i = __pyx_t_4;
19694 
19695  /* "View.MemoryView":1292
19696  *
19697  * for i in range(ndim):
19698  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19699  * if src.shape[i] == 1:
19700  * broadcasting = True
19701  */
19702  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19703  if (__pyx_t_2) {
19704 
19705  /* "View.MemoryView":1293
19706  * for i in range(ndim):
19707  * if src.shape[i] != dst.shape[i]:
19708  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19709  * broadcasting = True
19710  * src.strides[i] = 0
19711  */
19712  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19713  if (__pyx_t_2) {
19714 
19715  /* "View.MemoryView":1294
19716  * if src.shape[i] != dst.shape[i]:
19717  * if src.shape[i] == 1:
19718  * broadcasting = True # <<<<<<<<<<<<<<
19719  * src.strides[i] = 0
19720  * else:
19721  */
19722  __pyx_v_broadcasting = 1;
19723 
19724  /* "View.MemoryView":1295
19725  * if src.shape[i] == 1:
19726  * broadcasting = True
19727  * src.strides[i] = 0 # <<<<<<<<<<<<<<
19728  * else:
19729  * _err_extents(i, dst.shape[i], src.shape[i])
19730  */
19731  (__pyx_v_src.strides[__pyx_v_i]) = 0;
19732 
19733  /* "View.MemoryView":1293
19734  * for i in range(ndim):
19735  * if src.shape[i] != dst.shape[i]:
19736  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19737  * broadcasting = True
19738  * src.strides[i] = 0
19739  */
19740  goto __pyx_L7;
19741  }
19742 
19743  /* "View.MemoryView":1297
19744  * src.strides[i] = 0
19745  * else:
19746  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
19747  *
19748  * if src.suboffsets[i] >= 0:
19749  */
19750  /*else*/ {
19751  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
19752  }
19753  __pyx_L7:;
19754 
19755  /* "View.MemoryView":1292
19756  *
19757  * for i in range(ndim):
19758  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19759  * if src.shape[i] == 1:
19760  * broadcasting = True
19761  */
19762  }
19763 
19764  /* "View.MemoryView":1299
19765  * _err_extents(i, dst.shape[i], src.shape[i])
19766  *
19767  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
19768  * _err_dim(ValueError, "Dimension %d is not direct", i)
19769  *
19770  */
19771  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
19772  if (__pyx_t_2) {
19773 
19774  /* "View.MemoryView":1300
19775  *
19776  * if src.suboffsets[i] >= 0:
19777  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
19778  *
19779  * if slices_overlap(&src, &dst, ndim, itemsize):
19780  */
19781  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
19782 
19783  /* "View.MemoryView":1299
19784  * _err_extents(i, dst.shape[i], src.shape[i])
19785  *
19786  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
19787  * _err_dim(ValueError, "Dimension %d is not direct", i)
19788  *
19789  */
19790  }
19791  }
19792 
19793  /* "View.MemoryView":1302
19794  * _err_dim(ValueError, "Dimension %d is not direct", i)
19795  *
19796  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
19797  *
19798  * if not slice_is_contig(src, order, ndim):
19799  */
19800  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
19801  if (__pyx_t_2) {
19802 
19803  /* "View.MemoryView":1304
19804  * if slices_overlap(&src, &dst, ndim, itemsize):
19805  *
19806  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
19807  * order = get_best_order(&dst, ndim)
19808  *
19809  */
19810  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
19811  if (__pyx_t_2) {
19812 
19813  /* "View.MemoryView":1305
19814  *
19815  * if not slice_is_contig(src, order, ndim):
19816  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
19817  *
19818  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
19819  */
19820  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
19821 
19822  /* "View.MemoryView":1304
19823  * if slices_overlap(&src, &dst, ndim, itemsize):
19824  *
19825  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
19826  * order = get_best_order(&dst, ndim)
19827  *
19828  */
19829  }
19830 
19831  /* "View.MemoryView":1307
19832  * order = get_best_order(&dst, ndim)
19833  *
19834  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
19835  * src = tmp
19836  *
19837  */
19838  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error)
19839  __pyx_v_tmpdata = __pyx_t_7;
19840 
19841  /* "View.MemoryView":1308
19842  *
19843  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
19844  * src = tmp # <<<<<<<<<<<<<<
19845  *
19846  * if not broadcasting:
19847  */
19848  __pyx_v_src = __pyx_v_tmp;
19849 
19850  /* "View.MemoryView":1302
19851  * _err_dim(ValueError, "Dimension %d is not direct", i)
19852  *
19853  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
19854  *
19855  * if not slice_is_contig(src, order, ndim):
19856  */
19857  }
19858 
19859  /* "View.MemoryView":1310
19860  * src = tmp
19861  *
19862  * if not broadcasting: # <<<<<<<<<<<<<<
19863  *
19864  *
19865  */
19866  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
19867  if (__pyx_t_2) {
19868 
19869  /* "View.MemoryView":1313
19870  *
19871  *
19872  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
19873  * direct_copy = slice_is_contig(dst, 'C', ndim)
19874  * elif slice_is_contig(src, 'F', ndim):
19875  */
19876  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
19877  if (__pyx_t_2) {
19878 
19879  /* "View.MemoryView":1314
19880  *
19881  * if slice_is_contig(src, 'C', ndim):
19882  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
19883  * elif slice_is_contig(src, 'F', ndim):
19884  * direct_copy = slice_is_contig(dst, 'F', ndim)
19885  */
19886  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
19887 
19888  /* "View.MemoryView":1313
19889  *
19890  *
19891  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
19892  * direct_copy = slice_is_contig(dst, 'C', ndim)
19893  * elif slice_is_contig(src, 'F', ndim):
19894  */
19895  goto __pyx_L12;
19896  }
19897 
19898  /* "View.MemoryView":1315
19899  * if slice_is_contig(src, 'C', ndim):
19900  * direct_copy = slice_is_contig(dst, 'C', ndim)
19901  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
19902  * direct_copy = slice_is_contig(dst, 'F', ndim)
19903  *
19904  */
19905  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
19906  if (__pyx_t_2) {
19907 
19908  /* "View.MemoryView":1316
19909  * direct_copy = slice_is_contig(dst, 'C', ndim)
19910  * elif slice_is_contig(src, 'F', ndim):
19911  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
19912  *
19913  * if direct_copy:
19914  */
19915  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
19916 
19917  /* "View.MemoryView":1315
19918  * if slice_is_contig(src, 'C', ndim):
19919  * direct_copy = slice_is_contig(dst, 'C', ndim)
19920  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
19921  * direct_copy = slice_is_contig(dst, 'F', ndim)
19922  *
19923  */
19924  }
19925  __pyx_L12:;
19926 
19927  /* "View.MemoryView":1318
19928  * direct_copy = slice_is_contig(dst, 'F', ndim)
19929  *
19930  * if direct_copy: # <<<<<<<<<<<<<<
19931  *
19932  * refcount_copying(&dst, dtype_is_object, ndim, False)
19933  */
19934  __pyx_t_2 = (__pyx_v_direct_copy != 0);
19935  if (__pyx_t_2) {
19936 
19937  /* "View.MemoryView":1320
19938  * if direct_copy:
19939  *
19940  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
19941  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19942  * refcount_copying(&dst, dtype_is_object, ndim, True)
19943  */
19944  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19945 
19946  /* "View.MemoryView":1321
19947  *
19948  * refcount_copying(&dst, dtype_is_object, ndim, False)
19949  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
19950  * refcount_copying(&dst, dtype_is_object, ndim, True)
19951  * free(tmpdata)
19952  */
19953  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
19954 
19955  /* "View.MemoryView":1322
19956  * refcount_copying(&dst, dtype_is_object, ndim, False)
19957  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19958  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
19959  * free(tmpdata)
19960  * return 0
19961  */
19962  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19963 
19964  /* "View.MemoryView":1323
19965  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19966  * refcount_copying(&dst, dtype_is_object, ndim, True)
19967  * free(tmpdata) # <<<<<<<<<<<<<<
19968  * return 0
19969  *
19970  */
19971  free(__pyx_v_tmpdata);
19972 
19973  /* "View.MemoryView":1324
19974  * refcount_copying(&dst, dtype_is_object, ndim, True)
19975  * free(tmpdata)
19976  * return 0 # <<<<<<<<<<<<<<
19977  *
19978  * if order == 'F' == get_best_order(&dst, ndim):
19979  */
19980  __pyx_r = 0;
19981  goto __pyx_L0;
19982 
19983  /* "View.MemoryView":1318
19984  * direct_copy = slice_is_contig(dst, 'F', ndim)
19985  *
19986  * if direct_copy: # <<<<<<<<<<<<<<
19987  *
19988  * refcount_copying(&dst, dtype_is_object, ndim, False)
19989  */
19990  }
19991 
19992  /* "View.MemoryView":1310
19993  * src = tmp
19994  *
19995  * if not broadcasting: # <<<<<<<<<<<<<<
19996  *
19997  *
19998  */
19999  }
20000 
20001  /* "View.MemoryView":1326
20002  * return 0
20003  *
20004  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20005  *
20006  *
20007  */
20008  __pyx_t_2 = (__pyx_v_order == 'F');
20009  if (__pyx_t_2) {
20010  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
20011  }
20012  __pyx_t_8 = (__pyx_t_2 != 0);
20013  if (__pyx_t_8) {
20014 
20015  /* "View.MemoryView":1329
20016  *
20017  *
20018  * transpose_memslice(&src) # <<<<<<<<<<<<<<
20019  * transpose_memslice(&dst)
20020  *
20021  */
20022  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
20023 
20024  /* "View.MemoryView":1330
20025  *
20026  * transpose_memslice(&src)
20027  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
20028  *
20029  * refcount_copying(&dst, dtype_is_object, ndim, False)
20030  */
20031  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
20032 
20033  /* "View.MemoryView":1326
20034  * return 0
20035  *
20036  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20037  *
20038  *
20039  */
20040  }
20041 
20042  /* "View.MemoryView":1332
20043  * transpose_memslice(&dst)
20044  *
20045  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20046  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20047  * refcount_copying(&dst, dtype_is_object, ndim, True)
20048  */
20049  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20050 
20051  /* "View.MemoryView":1333
20052  *
20053  * refcount_copying(&dst, dtype_is_object, ndim, False)
20054  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
20055  * refcount_copying(&dst, dtype_is_object, ndim, True)
20056  *
20057  */
20058  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20059 
20060  /* "View.MemoryView":1334
20061  * refcount_copying(&dst, dtype_is_object, ndim, False)
20062  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20063  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20064  *
20065  * free(tmpdata)
20066  */
20067  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20068 
20069  /* "View.MemoryView":1336
20070  * refcount_copying(&dst, dtype_is_object, ndim, True)
20071  *
20072  * free(tmpdata) # <<<<<<<<<<<<<<
20073  * return 0
20074  *
20075  */
20076  free(__pyx_v_tmpdata);
20077 
20078  /* "View.MemoryView":1337
20079  *
20080  * free(tmpdata)
20081  * return 0 # <<<<<<<<<<<<<<
20082  *
20083  * @cname('__pyx_memoryview_broadcast_leading')
20084  */
20085  __pyx_r = 0;
20086  goto __pyx_L0;
20087 
20088  /* "View.MemoryView":1268
20089  *
20090  * @cname('__pyx_memoryview_copy_contents')
20091  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
20092  * __Pyx_memviewslice dst,
20093  * int src_ndim, int dst_ndim,
20094  */
20095 
20096  /* function exit code */
20097  __pyx_L1_error:;
20098  {
20099  #ifdef WITH_THREAD
20100  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20101  #endif
20102  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20103  #ifdef WITH_THREAD
20104  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20105  #endif
20106  }
20107  __pyx_r = -1;
20108  __pyx_L0:;
20109  __Pyx_TraceReturn(Py_None, 1);
20110  return __pyx_r;
20111 }
20112 
20113 /* "View.MemoryView":1340
20114  *
20115  * @cname('__pyx_memoryview_broadcast_leading')
20116  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20117  * int ndim,
20118  * int ndim_other) nogil:
20119  */
20120 
20121 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
20122  int __pyx_v_i;
20123  int __pyx_v_offset;
20124  __Pyx_TraceDeclarations
20125  int __pyx_t_1;
20126  int __pyx_t_2;
20127  int __pyx_t_3;
20128  int __pyx_lineno = 0;
20129  const char *__pyx_filename = NULL;
20130  int __pyx_clineno = 0;
20131  __Pyx_TraceCall("broadcast_leading", __pyx_f[1], 1340, 1, __PYX_ERR(1, 1340, __pyx_L1_error));
20132 
20133  /* "View.MemoryView":1344
20134  * int ndim_other) nogil:
20135  * cdef int i
20136  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
20137  *
20138  * for i in range(ndim - 1, -1, -1):
20139  */
20140  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20141 
20142  /* "View.MemoryView":1346
20143  * cdef int offset = ndim_other - ndim
20144  *
20145  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
20146  * mslice.shape[i + offset] = mslice.shape[i]
20147  * mslice.strides[i + offset] = mslice.strides[i]
20148  */
20149  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20150  __pyx_v_i = __pyx_t_1;
20151 
20152  /* "View.MemoryView":1347
20153  *
20154  * for i in range(ndim - 1, -1, -1):
20155  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
20156  * mslice.strides[i + offset] = mslice.strides[i]
20157  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20158  */
20159  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20160 
20161  /* "View.MemoryView":1348
20162  * for i in range(ndim - 1, -1, -1):
20163  * mslice.shape[i + offset] = mslice.shape[i]
20164  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
20165  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20166  *
20167  */
20168  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20169 
20170  /* "View.MemoryView":1349
20171  * mslice.shape[i + offset] = mslice.shape[i]
20172  * mslice.strides[i + offset] = mslice.strides[i]
20173  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
20174  *
20175  * for i in range(offset):
20176  */
20177  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20178  }
20179 
20180  /* "View.MemoryView":1351
20181  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20182  *
20183  * for i in range(offset): # <<<<<<<<<<<<<<
20184  * mslice.shape[i] = 1
20185  * mslice.strides[i] = mslice.strides[0]
20186  */
20187  __pyx_t_1 = __pyx_v_offset;
20188  __pyx_t_2 = __pyx_t_1;
20189  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20190  __pyx_v_i = __pyx_t_3;
20191 
20192  /* "View.MemoryView":1352
20193  *
20194  * for i in range(offset):
20195  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
20196  * mslice.strides[i] = mslice.strides[0]
20197  * mslice.suboffsets[i] = -1
20198  */
20199  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20200 
20201  /* "View.MemoryView":1353
20202  * for i in range(offset):
20203  * mslice.shape[i] = 1
20204  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
20205  * mslice.suboffsets[i] = -1
20206  *
20207  */
20208  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20209 
20210  /* "View.MemoryView":1354
20211  * mslice.shape[i] = 1
20212  * mslice.strides[i] = mslice.strides[0]
20213  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
20214  *
20215  *
20216  */
20217  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
20218  }
20219 
20220  /* "View.MemoryView":1340
20221  *
20222  * @cname('__pyx_memoryview_broadcast_leading')
20223  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20224  * int ndim,
20225  * int ndim_other) nogil:
20226  */
20227 
20228  /* function exit code */
20229  goto __pyx_L0;
20230  __pyx_L1_error:;
20231  __Pyx_WriteUnraisable("View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20232  __pyx_L0:;
20233  __Pyx_TraceReturn(Py_None, 1);
20234 }
20235 
20236 /* "View.MemoryView":1362
20237  *
20238  * @cname('__pyx_memoryview_refcount_copying')
20239  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20240  * int ndim, bint inc) nogil:
20241  *
20242  */
20243 
20244 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
20245  __Pyx_TraceDeclarations
20246  int __pyx_t_1;
20247  int __pyx_lineno = 0;
20248  const char *__pyx_filename = NULL;
20249  int __pyx_clineno = 0;
20250  __Pyx_TraceCall("refcount_copying", __pyx_f[1], 1362, 1, __PYX_ERR(1, 1362, __pyx_L1_error));
20251 
20252  /* "View.MemoryView":1366
20253  *
20254  *
20255  * if dtype_is_object: # <<<<<<<<<<<<<<
20256  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20257  * dst.strides, ndim, inc)
20258  */
20259  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20260  if (__pyx_t_1) {
20261 
20262  /* "View.MemoryView":1367
20263  *
20264  * if dtype_is_object:
20265  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
20266  * dst.strides, ndim, inc)
20267  *
20268  */
20269  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
20270 
20271  /* "View.MemoryView":1366
20272  *
20273  *
20274  * if dtype_is_object: # <<<<<<<<<<<<<<
20275  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20276  * dst.strides, ndim, inc)
20277  */
20278  }
20279 
20280  /* "View.MemoryView":1362
20281  *
20282  * @cname('__pyx_memoryview_refcount_copying')
20283  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20284  * int ndim, bint inc) nogil:
20285  *
20286  */
20287 
20288  /* function exit code */
20289  goto __pyx_L0;
20290  __pyx_L1_error:;
20291  __Pyx_WriteUnraisable("View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20292  __pyx_L0:;
20293  __Pyx_TraceReturn(Py_None, 1);
20294 }
20295 
20296 /* "View.MemoryView":1371
20297  *
20298  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20299  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20300  * Py_ssize_t *strides, int ndim,
20301  * bint inc) with gil:
20302  */
20303 
20304 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
20305  __Pyx_TraceDeclarations
20306  __Pyx_RefNannyDeclarations
20307  int __pyx_lineno = 0;
20308  const char *__pyx_filename = NULL;
20309  int __pyx_clineno = 0;
20310  #ifdef WITH_THREAD
20311  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20312  #endif
20313  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
20314  __Pyx_TraceCall("refcount_objects_in_slice_with_gil", __pyx_f[1], 1371, 0, __PYX_ERR(1, 1371, __pyx_L1_error));
20315 
20316  /* "View.MemoryView":1374
20317  * Py_ssize_t *strides, int ndim,
20318  * bint inc) with gil:
20319  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
20320  *
20321  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20322  */
20323  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20324 
20325  /* "View.MemoryView":1371
20326  *
20327  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20328  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20329  * Py_ssize_t *strides, int ndim,
20330  * bint inc) with gil:
20331  */
20332 
20333  /* function exit code */
20334  goto __pyx_L0;
20335  __pyx_L1_error:;
20336  __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20337  __pyx_L0:;
20338  __Pyx_TraceReturn(Py_None, 0);
20339  __Pyx_RefNannyFinishContext();
20340  #ifdef WITH_THREAD
20341  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20342  #endif
20343 }
20344 
20345 /* "View.MemoryView":1377
20346  *
20347  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20348  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20349  * Py_ssize_t *strides, int ndim, bint inc):
20350  * cdef Py_ssize_t i
20351  */
20352 
20353 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
20354  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20355  __Pyx_TraceDeclarations
20356  __Pyx_RefNannyDeclarations
20357  Py_ssize_t __pyx_t_1;
20358  Py_ssize_t __pyx_t_2;
20359  Py_ssize_t __pyx_t_3;
20360  int __pyx_t_4;
20361  int __pyx_lineno = 0;
20362  const char *__pyx_filename = NULL;
20363  int __pyx_clineno = 0;
20364  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
20365  __Pyx_TraceCall("refcount_objects_in_slice", __pyx_f[1], 1377, 0, __PYX_ERR(1, 1377, __pyx_L1_error));
20366 
20367  /* "View.MemoryView":1381
20368  * cdef Py_ssize_t i
20369  *
20370  * for i in range(shape[0]): # <<<<<<<<<<<<<<
20371  * if ndim == 1:
20372  * if inc:
20373  */
20374  __pyx_t_1 = (__pyx_v_shape[0]);
20375  __pyx_t_2 = __pyx_t_1;
20376  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20377  __pyx_v_i = __pyx_t_3;
20378 
20379  /* "View.MemoryView":1382
20380  *
20381  * for i in range(shape[0]):
20382  * if ndim == 1: # <<<<<<<<<<<<<<
20383  * if inc:
20384  * Py_INCREF((<PyObject **> data)[0])
20385  */
20386  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20387  if (__pyx_t_4) {
20388 
20389  /* "View.MemoryView":1383
20390  * for i in range(shape[0]):
20391  * if ndim == 1:
20392  * if inc: # <<<<<<<<<<<<<<
20393  * Py_INCREF((<PyObject **> data)[0])
20394  * else:
20395  */
20396  __pyx_t_4 = (__pyx_v_inc != 0);
20397  if (__pyx_t_4) {
20398 
20399  /* "View.MemoryView":1384
20400  * if ndim == 1:
20401  * if inc:
20402  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20403  * else:
20404  * Py_DECREF((<PyObject **> data)[0])
20405  */
20406  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20407 
20408  /* "View.MemoryView":1383
20409  * for i in range(shape[0]):
20410  * if ndim == 1:
20411  * if inc: # <<<<<<<<<<<<<<
20412  * Py_INCREF((<PyObject **> data)[0])
20413  * else:
20414  */
20415  goto __pyx_L6;
20416  }
20417 
20418  /* "View.MemoryView":1386
20419  * Py_INCREF((<PyObject **> data)[0])
20420  * else:
20421  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20422  * else:
20423  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20424  */
20425  /*else*/ {
20426  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20427  }
20428  __pyx_L6:;
20429 
20430  /* "View.MemoryView":1382
20431  *
20432  * for i in range(shape[0]):
20433  * if ndim == 1: # <<<<<<<<<<<<<<
20434  * if inc:
20435  * Py_INCREF((<PyObject **> data)[0])
20436  */
20437  goto __pyx_L5;
20438  }
20439 
20440  /* "View.MemoryView":1388
20441  * Py_DECREF((<PyObject **> data)[0])
20442  * else:
20443  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20444  * ndim - 1, inc)
20445  *
20446  */
20447  /*else*/ {
20448 
20449  /* "View.MemoryView":1389
20450  * else:
20451  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20452  * ndim - 1, inc) # <<<<<<<<<<<<<<
20453  *
20454  * data += strides[0]
20455  */
20456  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20457  }
20458  __pyx_L5:;
20459 
20460  /* "View.MemoryView":1391
20461  * ndim - 1, inc)
20462  *
20463  * data += strides[0] # <<<<<<<<<<<<<<
20464  *
20465  *
20466  */
20467  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20468  }
20469 
20470  /* "View.MemoryView":1377
20471  *
20472  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20473  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20474  * Py_ssize_t *strides, int ndim, bint inc):
20475  * cdef Py_ssize_t i
20476  */
20477 
20478  /* function exit code */
20479  goto __pyx_L0;
20480  __pyx_L1_error:;
20481  __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20482  __pyx_L0:;
20483  __Pyx_TraceReturn(Py_None, 0);
20484  __Pyx_RefNannyFinishContext();
20485 }
20486 
20487 /* "View.MemoryView":1397
20488  *
20489  * @cname('__pyx_memoryview_slice_assign_scalar')
20490  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20491  * size_t itemsize, void *item,
20492  * bint dtype_is_object) nogil:
20493  */
20494 
20495 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
20496  __Pyx_TraceDeclarations
20497  int __pyx_lineno = 0;
20498  const char *__pyx_filename = NULL;
20499  int __pyx_clineno = 0;
20500  __Pyx_TraceCall("slice_assign_scalar", __pyx_f[1], 1397, 1, __PYX_ERR(1, 1397, __pyx_L1_error));
20501 
20502  /* "View.MemoryView":1400
20503  * size_t itemsize, void *item,
20504  * bint dtype_is_object) nogil:
20505  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20506  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20507  * itemsize, item)
20508  */
20509  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20510 
20511  /* "View.MemoryView":1401
20512  * bint dtype_is_object) nogil:
20513  * refcount_copying(dst, dtype_is_object, ndim, False)
20514  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
20515  * itemsize, item)
20516  * refcount_copying(dst, dtype_is_object, ndim, True)
20517  */
20518  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
20519 
20520  /* "View.MemoryView":1403
20521  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20522  * itemsize, item)
20523  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20524  *
20525  *
20526  */
20527  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20528 
20529  /* "View.MemoryView":1397
20530  *
20531  * @cname('__pyx_memoryview_slice_assign_scalar')
20532  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20533  * size_t itemsize, void *item,
20534  * bint dtype_is_object) nogil:
20535  */
20536 
20537  /* function exit code */
20538  goto __pyx_L0;
20539  __pyx_L1_error:;
20540  __Pyx_WriteUnraisable("View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20541  __pyx_L0:;
20542  __Pyx_TraceReturn(Py_None, 1);
20543 }
20544 
20545 /* "View.MemoryView":1407
20546  *
20547  * @cname('__pyx_memoryview__slice_assign_scalar')
20548  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20549  * Py_ssize_t *strides, int ndim,
20550  * size_t itemsize, void *item) nogil:
20551  */
20552 
20553 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
20554  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20555  Py_ssize_t __pyx_v_stride;
20556  Py_ssize_t __pyx_v_extent;
20557  __Pyx_TraceDeclarations
20558  int __pyx_t_1;
20559  Py_ssize_t __pyx_t_2;
20560  Py_ssize_t __pyx_t_3;
20561  Py_ssize_t __pyx_t_4;
20562  int __pyx_lineno = 0;
20563  const char *__pyx_filename = NULL;
20564  int __pyx_clineno = 0;
20565  __Pyx_TraceCall("_slice_assign_scalar", __pyx_f[1], 1407, 1, __PYX_ERR(1, 1407, __pyx_L1_error));
20566 
20567  /* "View.MemoryView":1411
20568  * size_t itemsize, void *item) nogil:
20569  * cdef Py_ssize_t i
20570  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
20571  * cdef Py_ssize_t extent = shape[0]
20572  *
20573  */
20574  __pyx_v_stride = (__pyx_v_strides[0]);
20575 
20576  /* "View.MemoryView":1412
20577  * cdef Py_ssize_t i
20578  * cdef Py_ssize_t stride = strides[0]
20579  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
20580  *
20581  * if ndim == 1:
20582  */
20583  __pyx_v_extent = (__pyx_v_shape[0]);
20584 
20585  /* "View.MemoryView":1414
20586  * cdef Py_ssize_t extent = shape[0]
20587  *
20588  * if ndim == 1: # <<<<<<<<<<<<<<
20589  * for i in range(extent):
20590  * memcpy(data, item, itemsize)
20591  */
20592  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20593  if (__pyx_t_1) {
20594 
20595  /* "View.MemoryView":1415
20596  *
20597  * if ndim == 1:
20598  * for i in range(extent): # <<<<<<<<<<<<<<
20599  * memcpy(data, item, itemsize)
20600  * data += stride
20601  */
20602  __pyx_t_2 = __pyx_v_extent;
20603  __pyx_t_3 = __pyx_t_2;
20604  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20605  __pyx_v_i = __pyx_t_4;
20606 
20607  /* "View.MemoryView":1416
20608  * if ndim == 1:
20609  * for i in range(extent):
20610  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
20611  * data += stride
20612  * else:
20613  */
20614  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20615 
20616  /* "View.MemoryView":1417
20617  * for i in range(extent):
20618  * memcpy(data, item, itemsize)
20619  * data += stride # <<<<<<<<<<<<<<
20620  * else:
20621  * for i in range(extent):
20622  */
20623  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20624  }
20625 
20626  /* "View.MemoryView":1414
20627  * cdef Py_ssize_t extent = shape[0]
20628  *
20629  * if ndim == 1: # <<<<<<<<<<<<<<
20630  * for i in range(extent):
20631  * memcpy(data, item, itemsize)
20632  */
20633  goto __pyx_L3;
20634  }
20635 
20636  /* "View.MemoryView":1419
20637  * data += stride
20638  * else:
20639  * for i in range(extent): # <<<<<<<<<<<<<<
20640  * _slice_assign_scalar(data, shape + 1, strides + 1,
20641  * ndim - 1, itemsize, item)
20642  */
20643  /*else*/ {
20644  __pyx_t_2 = __pyx_v_extent;
20645  __pyx_t_3 = __pyx_t_2;
20646  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20647  __pyx_v_i = __pyx_t_4;
20648 
20649  /* "View.MemoryView":1420
20650  * else:
20651  * for i in range(extent):
20652  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20653  * ndim - 1, itemsize, item)
20654  * data += stride
20655  */
20656  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
20657 
20658  /* "View.MemoryView":1422
20659  * _slice_assign_scalar(data, shape + 1, strides + 1,
20660  * ndim - 1, itemsize, item)
20661  * data += stride # <<<<<<<<<<<<<<
20662  *
20663  *
20664  */
20665  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20666  }
20667  }
20668  __pyx_L3:;
20669 
20670  /* "View.MemoryView":1407
20671  *
20672  * @cname('__pyx_memoryview__slice_assign_scalar')
20673  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20674  * Py_ssize_t *strides, int ndim,
20675  * size_t itemsize, void *item) nogil:
20676  */
20677 
20678  /* function exit code */
20679  goto __pyx_L0;
20680  __pyx_L1_error:;
20681  __Pyx_WriteUnraisable("View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20682  __pyx_L0:;
20683  __Pyx_TraceReturn(Py_None, 1);
20684 }
20685 
20686 /* "(tree fragment)":1
20687  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20688  * cdef object __pyx_PickleError
20689  * cdef object __pyx_result
20690  */
20691 
20692 /* Python wrapper */
20693 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
20694 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
20695 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20696  PyObject *__pyx_v___pyx_type = 0;
20697  long __pyx_v___pyx_checksum;
20698  PyObject *__pyx_v___pyx_state = 0;
20699  int __pyx_lineno = 0;
20700  const char *__pyx_filename = NULL;
20701  int __pyx_clineno = 0;
20702  PyObject *__pyx_r = 0;
20703  __Pyx_RefNannyDeclarations
20704  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
20705  {
20706  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20707  PyObject* values[3] = {0,0,0};
20708  if (unlikely(__pyx_kwds)) {
20709  Py_ssize_t kw_args;
20710  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20711  switch (pos_args) {
20712  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20713  CYTHON_FALLTHROUGH;
20714  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20715  CYTHON_FALLTHROUGH;
20716  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20717  CYTHON_FALLTHROUGH;
20718  case 0: break;
20719  default: goto __pyx_L5_argtuple_error;
20720  }
20721  kw_args = PyDict_Size(__pyx_kwds);
20722  switch (pos_args) {
20723  case 0:
20724  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20725  else goto __pyx_L5_argtuple_error;
20726  CYTHON_FALLTHROUGH;
20727  case 1:
20728  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20729  else {
20730  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
20731  }
20732  CYTHON_FALLTHROUGH;
20733  case 2:
20734  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20735  else {
20736  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
20737  }
20738  }
20739  if (unlikely(kw_args > 0)) {
20740  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
20741  }
20742  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20743  goto __pyx_L5_argtuple_error;
20744  } else {
20745  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20746  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20747  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20748  }
20749  __pyx_v___pyx_type = values[0];
20750  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
20751  __pyx_v___pyx_state = values[2];
20752  }
20753  goto __pyx_L4_argument_unpacking_done;
20754  __pyx_L5_argtuple_error:;
20755  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
20756  __pyx_L3_error:;
20757  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20758  __Pyx_RefNannyFinishContext();
20759  return NULL;
20760  __pyx_L4_argument_unpacking_done:;
20761  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20762 
20763  /* function exit code */
20764  __Pyx_RefNannyFinishContext();
20765  return __pyx_r;
20766 }
20767 
20768 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
20769  PyObject *__pyx_v___pyx_PickleError = 0;
20770  PyObject *__pyx_v___pyx_result = 0;
20771  PyObject *__pyx_r = NULL;
20772  __Pyx_TraceDeclarations
20773  __Pyx_RefNannyDeclarations
20774  int __pyx_t_1;
20775  PyObject *__pyx_t_2 = NULL;
20776  PyObject *__pyx_t_3 = NULL;
20777  PyObject *__pyx_t_4 = NULL;
20778  PyObject *__pyx_t_5 = NULL;
20779  int __pyx_t_6;
20780  int __pyx_lineno = 0;
20781  const char *__pyx_filename = NULL;
20782  int __pyx_clineno = 0;
20783  __Pyx_TraceFrameInit(__pyx_codeobj__34)
20784  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
20785  __Pyx_TraceCall("__pyx_unpickle_Enum", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
20786 
20787  /* "(tree fragment)":4
20788  * cdef object __pyx_PickleError
20789  * cdef object __pyx_result
20790  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
20791  * from pickle import PickleError as __pyx_PickleError
20792  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20793  */
20794  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
20795  if (__pyx_t_1) {
20796 
20797  /* "(tree fragment)":5
20798  * cdef object __pyx_result
20799  * if __pyx_checksum != 0xb068931:
20800  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
20801  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20802  * __pyx_result = Enum.__new__(__pyx_type)
20803  */
20804  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
20805  __Pyx_GOTREF(__pyx_t_2);
20806  __Pyx_INCREF(__pyx_n_s_PickleError);
20807  __Pyx_GIVEREF(__pyx_n_s_PickleError);
20808  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
20809  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
20810  __Pyx_GOTREF(__pyx_t_3);
20811  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20812  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
20813  __Pyx_GOTREF(__pyx_t_2);
20814  __Pyx_INCREF(__pyx_t_2);
20815  __pyx_v___pyx_PickleError = __pyx_t_2;
20816  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20817  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20818 
20819  /* "(tree fragment)":6
20820  * if __pyx_checksum != 0xb068931:
20821  * from pickle import PickleError as __pyx_PickleError
20822  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
20823  * __pyx_result = Enum.__new__(__pyx_type)
20824  * if __pyx_state is not None:
20825  */
20826  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
20827  __Pyx_GOTREF(__pyx_t_2);
20828  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
20829  __Pyx_GOTREF(__pyx_t_4);
20830  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20831  __Pyx_INCREF(__pyx_v___pyx_PickleError);
20832  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
20833  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
20834  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
20835  if (likely(__pyx_t_5)) {
20836  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20837  __Pyx_INCREF(__pyx_t_5);
20838  __Pyx_INCREF(function);
20839  __Pyx_DECREF_SET(__pyx_t_2, function);
20840  }
20841  }
20842  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
20843  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20844  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20845  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
20846  __Pyx_GOTREF(__pyx_t_3);
20847  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20848  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20849  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20850  __PYX_ERR(1, 6, __pyx_L1_error)
20851 
20852  /* "(tree fragment)":4
20853  * cdef object __pyx_PickleError
20854  * cdef object __pyx_result
20855  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
20856  * from pickle import PickleError as __pyx_PickleError
20857  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20858  */
20859  }
20860 
20861  /* "(tree fragment)":7
20862  * from pickle import PickleError as __pyx_PickleError
20863  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20864  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
20865  * if __pyx_state is not None:
20866  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20867  */
20868  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
20869  __Pyx_GOTREF(__pyx_t_2);
20870  __pyx_t_4 = NULL;
20871  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
20872  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
20873  if (likely(__pyx_t_4)) {
20874  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20875  __Pyx_INCREF(__pyx_t_4);
20876  __Pyx_INCREF(function);
20877  __Pyx_DECREF_SET(__pyx_t_2, function);
20878  }
20879  }
20880  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
20881  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
20882  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
20883  __Pyx_GOTREF(__pyx_t_3);
20884  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20885  __pyx_v___pyx_result = __pyx_t_3;
20886  __pyx_t_3 = 0;
20887 
20888  /* "(tree fragment)":8
20889  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20890  * __pyx_result = Enum.__new__(__pyx_type)
20891  * if __pyx_state is not None: # <<<<<<<<<<<<<<
20892  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20893  * return __pyx_result
20894  */
20895  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
20896  __pyx_t_6 = (__pyx_t_1 != 0);
20897  if (__pyx_t_6) {
20898 
20899  /* "(tree fragment)":9
20900  * __pyx_result = Enum.__new__(__pyx_type)
20901  * if __pyx_state is not None:
20902  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
20903  * return __pyx_result
20904  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20905  */
20906  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
20907  __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
20908  __Pyx_GOTREF(__pyx_t_3);
20909  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20910 
20911  /* "(tree fragment)":8
20912  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20913  * __pyx_result = Enum.__new__(__pyx_type)
20914  * if __pyx_state is not None: # <<<<<<<<<<<<<<
20915  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20916  * return __pyx_result
20917  */
20918  }
20919 
20920  /* "(tree fragment)":10
20921  * if __pyx_state is not None:
20922  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20923  * return __pyx_result # <<<<<<<<<<<<<<
20924  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20925  * __pyx_result.name = __pyx_state[0]
20926  */
20927  __Pyx_XDECREF(__pyx_r);
20928  __Pyx_INCREF(__pyx_v___pyx_result);
20929  __pyx_r = __pyx_v___pyx_result;
20930  goto __pyx_L0;
20931 
20932  /* "(tree fragment)":1
20933  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20934  * cdef object __pyx_PickleError
20935  * cdef object __pyx_result
20936  */
20937 
20938  /* function exit code */
20939  __pyx_L1_error:;
20940  __Pyx_XDECREF(__pyx_t_2);
20941  __Pyx_XDECREF(__pyx_t_3);
20942  __Pyx_XDECREF(__pyx_t_4);
20943  __Pyx_XDECREF(__pyx_t_5);
20944  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20945  __pyx_r = NULL;
20946  __pyx_L0:;
20947  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
20948  __Pyx_XDECREF(__pyx_v___pyx_result);
20949  __Pyx_XGIVEREF(__pyx_r);
20950  __Pyx_TraceReturn(__pyx_r, 0);
20951  __Pyx_RefNannyFinishContext();
20952  return __pyx_r;
20953 }
20954 
20955 /* "(tree fragment)":11
20956  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20957  * return __pyx_result
20958  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
20959  * __pyx_result.name = __pyx_state[0]
20960  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20961  */
20962 
20963 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
20964  PyObject *__pyx_r = NULL;
20965  __Pyx_TraceDeclarations
20966  __Pyx_RefNannyDeclarations
20967  PyObject *__pyx_t_1 = NULL;
20968  int __pyx_t_2;
20969  Py_ssize_t __pyx_t_3;
20970  int __pyx_t_4;
20971  int __pyx_t_5;
20972  PyObject *__pyx_t_6 = NULL;
20973  PyObject *__pyx_t_7 = NULL;
20974  PyObject *__pyx_t_8 = NULL;
20975  int __pyx_lineno = 0;
20976  const char *__pyx_filename = NULL;
20977  int __pyx_clineno = 0;
20978  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
20979  __Pyx_TraceCall("__pyx_unpickle_Enum__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
20980 
20981  /* "(tree fragment)":12
20982  * return __pyx_result
20983  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20984  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
20985  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20986  * __pyx_result.__dict__.update(__pyx_state[1])
20987  */
20988  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20989  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
20990  __PYX_ERR(1, 12, __pyx_L1_error)
20991  }
20992  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
20993  __Pyx_GOTREF(__pyx_t_1);
20994  __Pyx_GIVEREF(__pyx_t_1);
20995  __Pyx_GOTREF(__pyx_v___pyx_result->name);
20996  __Pyx_DECREF(__pyx_v___pyx_result->name);
20997  __pyx_v___pyx_result->name = __pyx_t_1;
20998  __pyx_t_1 = 0;
20999 
21000  /* "(tree fragment)":13
21001  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21002  * __pyx_result.name = __pyx_state[0]
21003  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21004  * __pyx_result.__dict__.update(__pyx_state[1])
21005  */
21006  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21007  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
21008  __PYX_ERR(1, 13, __pyx_L1_error)
21009  }
21010  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21011  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
21012  if (__pyx_t_4) {
21013  } else {
21014  __pyx_t_2 = __pyx_t_4;
21015  goto __pyx_L4_bool_binop_done;
21016  }
21017  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21018  __pyx_t_5 = (__pyx_t_4 != 0);
21019  __pyx_t_2 = __pyx_t_5;
21020  __pyx_L4_bool_binop_done:;
21021  if (__pyx_t_2) {
21022 
21023  /* "(tree fragment)":14
21024  * __pyx_result.name = __pyx_state[0]
21025  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21026  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
21027  */
21028  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21029  __Pyx_GOTREF(__pyx_t_6);
21030  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
21031  __Pyx_GOTREF(__pyx_t_7);
21032  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21033  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21034  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21035  __PYX_ERR(1, 14, __pyx_L1_error)
21036  }
21037  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21038  __Pyx_GOTREF(__pyx_t_6);
21039  __pyx_t_8 = NULL;
21040  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21041  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21042  if (likely(__pyx_t_8)) {
21043  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
21044  __Pyx_INCREF(__pyx_t_8);
21045  __Pyx_INCREF(function);
21046  __Pyx_DECREF_SET(__pyx_t_7, function);
21047  }
21048  }
21049  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
21050  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21051  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21052  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
21053  __Pyx_GOTREF(__pyx_t_1);
21054  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21055  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21056 
21057  /* "(tree fragment)":13
21058  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21059  * __pyx_result.name = __pyx_state[0]
21060  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21061  * __pyx_result.__dict__.update(__pyx_state[1])
21062  */
21063  }
21064 
21065  /* "(tree fragment)":11
21066  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21067  * return __pyx_result
21068  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21069  * __pyx_result.name = __pyx_state[0]
21070  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21071  */
21072 
21073  /* function exit code */
21074  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21075  goto __pyx_L0;
21076  __pyx_L1_error:;
21077  __Pyx_XDECREF(__pyx_t_1);
21078  __Pyx_XDECREF(__pyx_t_6);
21079  __Pyx_XDECREF(__pyx_t_7);
21080  __Pyx_XDECREF(__pyx_t_8);
21081  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21082  __pyx_r = 0;
21083  __pyx_L0:;
21084  __Pyx_XGIVEREF(__pyx_r);
21085  __Pyx_TraceReturn(__pyx_r, 0);
21086  __Pyx_RefNannyFinishContext();
21087  return __pyx_r;
21088 }
21089 
21090 static PyObject *__pyx_tp_new_18BoundaryConditions_BC_Base(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21091  struct __pyx_obj_18BoundaryConditions_BC_Base *p;
21092  PyObject *o;
21093  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21094  o = (*t->tp_alloc)(t, 0);
21095  } else {
21096  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21097  }
21098  if (unlikely(!o)) return 0;
21099  p = ((struct __pyx_obj_18BoundaryConditions_BC_Base *)o);
21100  p->Shape = Py_None; Py_INCREF(Py_None);
21101  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
21102  p->BC_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
21103  p->ct = Py_None; Py_INCREF(Py_None);
21104  p->_b_or.data = NULL;
21105  p->_b_or.memview = NULL;
21106  return o;
21107 }
21108 
21109 static void __pyx_tp_dealloc_18BoundaryConditions_BC_Base(PyObject *o) {
21110  struct __pyx_obj_18BoundaryConditions_BC_Base *p = (struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21111  #if CYTHON_USE_TP_FINALIZE
21112  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21113  if (PyObject_CallFinalizerFromDealloc(o)) return;
21114  }
21115  #endif
21116  PyObject_GC_UnTrack(o);
21117  Py_CLEAR(p->Shape);
21118  Py_CLEAR(p->name);
21119  Py_CLEAR(p->BC_type);
21120  Py_CLEAR(p->ct);
21121  __PYX_XDEC_MEMVIEW(&p->_b_or, 1);
21122  (*Py_TYPE(o)->tp_free)(o);
21123 }
21124 
21125 static int __pyx_tp_traverse_18BoundaryConditions_BC_Base(PyObject *o, visitproc v, void *a) {
21126  int e;
21127  struct __pyx_obj_18BoundaryConditions_BC_Base *p = (struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21128  if (p->Shape) {
21129  e = (*v)(p->Shape, a); if (e) return e;
21130  }
21131  if (p->ct) {
21132  e = (*v)(p->ct, a); if (e) return e;
21133  }
21134  return 0;
21135 }
21136 
21137 static int __pyx_tp_clear_18BoundaryConditions_BC_Base(PyObject *o) {
21138  PyObject* tmp;
21139  struct __pyx_obj_18BoundaryConditions_BC_Base *p = (struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21140  tmp = ((PyObject*)p->Shape);
21141  p->Shape = Py_None; Py_INCREF(Py_None);
21142  Py_XDECREF(tmp);
21143  tmp = ((PyObject*)p->ct);
21144  p->ct = Py_None; Py_INCREF(Py_None);
21145  Py_XDECREF(tmp);
21146  return 0;
21147 }
21148 
21149 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_nd(PyObject *o, CYTHON_UNUSED void *x) {
21150  return __pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(o);
21151 }
21152 
21153 static int __pyx_setprop_18BoundaryConditions_7BC_Base_nd(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21154  if (v) {
21155  return __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(o, v);
21156  }
21157  else {
21158  PyErr_SetString(PyExc_NotImplementedError, "__del__");
21159  return -1;
21160  }
21161 }
21162 
21163 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_Shape(PyObject *o, CYTHON_UNUSED void *x) {
21164  return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(o);
21165 }
21166 
21167 static int __pyx_setprop_18BoundaryConditions_7BC_Base_Shape(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21168  if (v) {
21169  return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(o, v);
21170  }
21171  else {
21172  return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(o);
21173  }
21174 }
21175 
21176 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_name(PyObject *o, CYTHON_UNUSED void *x) {
21177  return __pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(o);
21178 }
21179 
21180 static int __pyx_setprop_18BoundaryConditions_7BC_Base_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21181  if (v) {
21182  return __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(o, v);
21183  }
21184  else {
21185  return __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(o);
21186  }
21187 }
21188 
21189 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_BC_type(PyObject *o, CYTHON_UNUSED void *x) {
21190  return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(o);
21191 }
21192 
21193 static int __pyx_setprop_18BoundaryConditions_7BC_Base_BC_type(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21194  if (v) {
21195  return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(o, v);
21196  }
21197  else {
21198  return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(o);
21199  }
21200 }
21201 
21202 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_ct(PyObject *o, CYTHON_UNUSED void *x) {
21203  return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(o);
21204 }
21205 
21206 static int __pyx_setprop_18BoundaryConditions_7BC_Base_ct(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21207  if (v) {
21208  return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(o, v);
21209  }
21210  else {
21211  return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(o);
21212  }
21213 }
21214 
21215 static PyMethodDef __pyx_methods_18BoundaryConditions_BC_Base[] = {
21216  {"getContext", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_7BC_Base_3getContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_7BC_Base_2getContext},
21217  {"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_7BC_Base_4__reduce_cython__},
21218  {"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_7BC_Base_6__setstate_cython__},
21219  {0, 0, 0, 0}
21220 };
21221 
21222 static struct PyGetSetDef __pyx_getsets_18BoundaryConditions_BC_Base[] = {
21223  {(char *)"nd", __pyx_getprop_18BoundaryConditions_7BC_Base_nd, __pyx_setprop_18BoundaryConditions_7BC_Base_nd, (char *)"nd: 'int'", 0},
21224  {(char *)"Shape", __pyx_getprop_18BoundaryConditions_7BC_Base_Shape, __pyx_setprop_18BoundaryConditions_7BC_Base_Shape, (char *)"Shape: object", 0},
21225  {(char *)"name", __pyx_getprop_18BoundaryConditions_7BC_Base_name, __pyx_setprop_18BoundaryConditions_7BC_Base_name, (char *)"name: str", 0},
21226  {(char *)"BC_type", __pyx_getprop_18BoundaryConditions_7BC_Base_BC_type, __pyx_setprop_18BoundaryConditions_7BC_Base_BC_type, (char *)"BC_type: str", 0},
21227  {(char *)"ct", __pyx_getprop_18BoundaryConditions_7BC_Base_ct, __pyx_setprop_18BoundaryConditions_7BC_Base_ct, (char *)"ct: object", 0},
21228  {0, 0, 0, 0, 0}
21229 };
21230 
21231 static PyTypeObject __pyx_type_18BoundaryConditions_BC_Base = {
21232  PyVarObject_HEAD_INIT(0, 0)
21233  "BoundaryConditions.BC_Base", /*tp_name*/
21234  sizeof(struct __pyx_obj_18BoundaryConditions_BC_Base), /*tp_basicsize*/
21235  0, /*tp_itemsize*/
21236  __pyx_tp_dealloc_18BoundaryConditions_BC_Base, /*tp_dealloc*/
21237  #if PY_VERSION_HEX < 0x030800b4
21238  0, /*tp_print*/
21239  #endif
21240  #if PY_VERSION_HEX >= 0x030800b4
21241  0, /*tp_vectorcall_offset*/
21242  #endif
21243  0, /*tp_getattr*/
21244  0, /*tp_setattr*/
21245  #if PY_MAJOR_VERSION < 3
21246  0, /*tp_compare*/
21247  #endif
21248  #if PY_MAJOR_VERSION >= 3
21249  0, /*tp_as_async*/
21250  #endif
21251  0, /*tp_repr*/
21252  0, /*tp_as_number*/
21253  0, /*tp_as_sequence*/
21254  0, /*tp_as_mapping*/
21255  0, /*tp_hash*/
21256  0, /*tp_call*/
21257  0, /*tp_str*/
21258  0, /*tp_getattro*/
21259  0, /*tp_setattro*/
21260  0, /*tp_as_buffer*/
21261  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21262  "BC_Base(shape=None, name=None, b_or=None, b_i=0, nd=None)\n\n Generic class regrouping boundary conditions\n ", /*tp_doc*/
21263  __pyx_tp_traverse_18BoundaryConditions_BC_Base, /*tp_traverse*/
21264  __pyx_tp_clear_18BoundaryConditions_BC_Base, /*tp_clear*/
21265  0, /*tp_richcompare*/
21266  0, /*tp_weaklistoffset*/
21267  0, /*tp_iter*/
21268  0, /*tp_iternext*/
21269  __pyx_methods_18BoundaryConditions_BC_Base, /*tp_methods*/
21270  0, /*tp_members*/
21271  __pyx_getsets_18BoundaryConditions_BC_Base, /*tp_getset*/
21272  0, /*tp_base*/
21273  0, /*tp_dict*/
21274  0, /*tp_descr_get*/
21275  0, /*tp_descr_set*/
21276  0, /*tp_dictoffset*/
21277  __pyx_pw_18BoundaryConditions_7BC_Base_1__init__, /*tp_init*/
21278  0, /*tp_alloc*/
21279  __pyx_tp_new_18BoundaryConditions_BC_Base, /*tp_new*/
21280  0, /*tp_free*/
21281  0, /*tp_is_gc*/
21282  0, /*tp_bases*/
21283  0, /*tp_mro*/
21284  0, /*tp_cache*/
21285  0, /*tp_subclasses*/
21286  0, /*tp_weaklist*/
21287  0, /*tp_del*/
21288  0, /*tp_version_tag*/
21289  #if PY_VERSION_HEX >= 0x030400a1
21290  0, /*tp_finalize*/
21291  #endif
21292  #if PY_VERSION_HEX >= 0x030800b1
21293  0, /*tp_vectorcall*/
21294  #endif
21295  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21296  0, /*tp_print*/
21297  #endif
21298 };
21299 static struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition __pyx_vtable_18BoundaryConditions_BoundaryCondition;
21300 
21301 static PyObject *__pyx_tp_new_18BoundaryConditions_BoundaryCondition(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21302  struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p;
21303  PyObject *o;
21304  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21305  o = (*t->tp_alloc)(t, 0);
21306  } else {
21307  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21308  }
21309  if (unlikely(!o)) return 0;
21310  p = ((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o);
21311  p->__pyx_vtab = __pyx_vtabptr_18BoundaryConditions_BoundaryCondition;
21312  p->uOfXT = Py_None; Py_INCREF(Py_None);
21313  return o;
21314 }
21315 
21316 static void __pyx_tp_dealloc_18BoundaryConditions_BoundaryCondition(PyObject *o) {
21317  struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21318  #if CYTHON_USE_TP_FINALIZE
21319  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21320  if (PyObject_CallFinalizerFromDealloc(o)) return;
21321  }
21322  #endif
21323  PyObject_GC_UnTrack(o);
21324  Py_CLEAR(p->uOfXT);
21325  (*Py_TYPE(o)->tp_free)(o);
21326 }
21327 
21328 static int __pyx_tp_traverse_18BoundaryConditions_BoundaryCondition(PyObject *o, visitproc v, void *a) {
21329  int e;
21330  struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21331  if (p->uOfXT) {
21332  e = (*v)(p->uOfXT, a); if (e) return e;
21333  }
21334  return 0;
21335 }
21336 
21337 static int __pyx_tp_clear_18BoundaryConditions_BoundaryCondition(PyObject *o) {
21338  PyObject* tmp;
21339  struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21340  tmp = ((PyObject*)p->uOfXT);
21341  p->uOfXT = Py_None; Py_INCREF(Py_None);
21342  Py_XDECREF(tmp);
21343  return 0;
21344 }
21345 
21346 static PyObject *__pyx_getprop_18BoundaryConditions_17BoundaryCondition_uOfXT(PyObject *o, CYTHON_UNUSED void *x) {
21347  return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(o);
21348 }
21349 
21350 static int __pyx_setprop_18BoundaryConditions_17BoundaryCondition_uOfXT(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21351  if (v) {
21352  return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(o, v);
21353  }
21354  else {
21355  return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(o);
21356  }
21357 }
21358 
21359 static PyMethodDef __pyx_methods_18BoundaryConditions_BoundaryCondition[] = {
21360  {"init_cython", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_2init_cython},
21361  {"setConstantBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC},
21362  {"setLinearBC", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC},
21363  {"setLinearRamp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp},
21364  {"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__},
21365  {"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__},
21366  {0, 0, 0, 0}
21367 };
21368 
21369 static struct PyGetSetDef __pyx_getsets_18BoundaryConditions_BoundaryCondition[] = {
21370  {(char *)"uOfXT", __pyx_getprop_18BoundaryConditions_17BoundaryCondition_uOfXT, __pyx_setprop_18BoundaryConditions_17BoundaryCondition_uOfXT, (char *)"uOfXT: object", 0},
21371  {0, 0, 0, 0, 0}
21372 };
21373 
21374 static PyTypeObject __pyx_type_18BoundaryConditions_BoundaryCondition = {
21375  PyVarObject_HEAD_INIT(0, 0)
21376  "BoundaryConditions.BoundaryCondition", /*tp_name*/
21377  sizeof(struct __pyx_obj_18BoundaryConditions_BoundaryCondition), /*tp_basicsize*/
21378  0, /*tp_itemsize*/
21379  __pyx_tp_dealloc_18BoundaryConditions_BoundaryCondition, /*tp_dealloc*/
21380  #if PY_VERSION_HEX < 0x030800b4
21381  0, /*tp_print*/
21382  #endif
21383  #if PY_VERSION_HEX >= 0x030800b4
21384  0, /*tp_vectorcall_offset*/
21385  #endif
21386  0, /*tp_getattr*/
21387  0, /*tp_setattr*/
21388  #if PY_MAJOR_VERSION < 3
21389  0, /*tp_compare*/
21390  #endif
21391  #if PY_MAJOR_VERSION >= 3
21392  0, /*tp_as_async*/
21393  #endif
21394  0, /*tp_repr*/
21395  0, /*tp_as_number*/
21396  0, /*tp_as_sequence*/
21397  0, /*tp_as_mapping*/
21398  0, /*tp_hash*/
21399  0, /*tp_call*/
21400  0, /*tp_str*/
21401  0, /*tp_getattro*/
21402  0, /*tp_setattro*/
21403  0, /*tp_as_buffer*/
21404  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21405  "BoundaryCondition()\n\n Boundary condition class\n\n Attributes\n ----------\n uOfXT: func or None\n boundary condition function of x (array_like) and t (float) or None for\n no boundary condition\n ", /*tp_doc*/
21406  __pyx_tp_traverse_18BoundaryConditions_BoundaryCondition, /*tp_traverse*/
21407  __pyx_tp_clear_18BoundaryConditions_BoundaryCondition, /*tp_clear*/
21408  0, /*tp_richcompare*/
21409  0, /*tp_weaklistoffset*/
21410  0, /*tp_iter*/
21411  0, /*tp_iternext*/
21412  __pyx_methods_18BoundaryConditions_BoundaryCondition, /*tp_methods*/
21413  0, /*tp_members*/
21414  __pyx_getsets_18BoundaryConditions_BoundaryCondition, /*tp_getset*/
21415  0, /*tp_base*/
21416  0, /*tp_dict*/
21417  0, /*tp_descr_get*/
21418  0, /*tp_descr_set*/
21419  0, /*tp_dictoffset*/
21420  __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__, /*tp_init*/
21421  0, /*tp_alloc*/
21422  __pyx_tp_new_18BoundaryConditions_BoundaryCondition, /*tp_new*/
21423  0, /*tp_free*/
21424  0, /*tp_is_gc*/
21425  0, /*tp_bases*/
21426  0, /*tp_mro*/
21427  0, /*tp_cache*/
21428  0, /*tp_subclasses*/
21429  0, /*tp_weaklist*/
21430  0, /*tp_del*/
21431  0, /*tp_version_tag*/
21432  #if PY_VERSION_HEX >= 0x030400a1
21433  0, /*tp_finalize*/
21434  #endif
21435  #if PY_VERSION_HEX >= 0x030800b1
21436  0, /*tp_vectorcall*/
21437  #endif
21438  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21439  0, /*tp_print*/
21440  #endif
21441 };
21442 
21443 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[8];
21444 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC = 0;
21445 
21446 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21447  PyObject *o;
21448  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC)))) {
21449  o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC];
21450  memset(o, 0, sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC));
21451  (void) PyObject_INIT(o, t);
21452  PyObject_GC_Track(o);
21453  } else {
21454  o = (*t->tp_alloc)(t, 0);
21455  if (unlikely(!o)) return 0;
21456  }
21457  return o;
21458 }
21459 
21460 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o) {
21461  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21462  PyObject_GC_UnTrack(o);
21463  Py_CLEAR(p->__pyx_v_value);
21464  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC)))) {
21465  __pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC++] = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o);
21466  } else {
21467  (*Py_TYPE(o)->tp_free)(o);
21468  }
21469 }
21470 
21471 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o, visitproc v, void *a) {
21472  int e;
21473  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21474  if (p->__pyx_v_value) {
21475  e = (*v)(p->__pyx_v_value, a); if (e) return e;
21476  }
21477  return 0;
21478 }
21479 
21480 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o) {
21481  PyObject* tmp;
21482  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21483  tmp = ((PyObject*)p->__pyx_v_value);
21484  p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
21485  Py_XDECREF(tmp);
21486  return 0;
21487 }
21488 
21489 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC = {
21490  PyVarObject_HEAD_INIT(0, 0)
21491  "BoundaryConditions.__pyx_scope_struct__setConstantBC", /*tp_name*/
21492  sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC), /*tp_basicsize*/
21493  0, /*tp_itemsize*/
21494  __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct__setConstantBC, /*tp_dealloc*/
21495  #if PY_VERSION_HEX < 0x030800b4
21496  0, /*tp_print*/
21497  #endif
21498  #if PY_VERSION_HEX >= 0x030800b4
21499  0, /*tp_vectorcall_offset*/
21500  #endif
21501  0, /*tp_getattr*/
21502  0, /*tp_setattr*/
21503  #if PY_MAJOR_VERSION < 3
21504  0, /*tp_compare*/
21505  #endif
21506  #if PY_MAJOR_VERSION >= 3
21507  0, /*tp_as_async*/
21508  #endif
21509  0, /*tp_repr*/
21510  0, /*tp_as_number*/
21511  0, /*tp_as_sequence*/
21512  0, /*tp_as_mapping*/
21513  0, /*tp_hash*/
21514  0, /*tp_call*/
21515  0, /*tp_str*/
21516  0, /*tp_getattro*/
21517  0, /*tp_setattro*/
21518  0, /*tp_as_buffer*/
21519  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21520  0, /*tp_doc*/
21521  __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct__setConstantBC, /*tp_traverse*/
21522  __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct__setConstantBC, /*tp_clear*/
21523  0, /*tp_richcompare*/
21524  0, /*tp_weaklistoffset*/
21525  0, /*tp_iter*/
21526  0, /*tp_iternext*/
21527  0, /*tp_methods*/
21528  0, /*tp_members*/
21529  0, /*tp_getset*/
21530  0, /*tp_base*/
21531  0, /*tp_dict*/
21532  0, /*tp_descr_get*/
21533  0, /*tp_descr_set*/
21534  0, /*tp_dictoffset*/
21535  0, /*tp_init*/
21536  0, /*tp_alloc*/
21537  __pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC, /*tp_new*/
21538  0, /*tp_free*/
21539  0, /*tp_is_gc*/
21540  0, /*tp_bases*/
21541  0, /*tp_mro*/
21542  0, /*tp_cache*/
21543  0, /*tp_subclasses*/
21544  0, /*tp_weaklist*/
21545  0, /*tp_del*/
21546  0, /*tp_version_tag*/
21547  #if PY_VERSION_HEX >= 0x030400a1
21548  0, /*tp_finalize*/
21549  #endif
21550  #if PY_VERSION_HEX >= 0x030800b1
21551  0, /*tp_vectorcall*/
21552  #endif
21553  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21554  0, /*tp_print*/
21555  #endif
21556 };
21557 
21558 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[8];
21559 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = 0;
21560 
21561 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21562  PyObject *o;
21563  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC)))) {
21564  o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC];
21565  memset(o, 0, sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC));
21566  (void) PyObject_INIT(o, t);
21567  PyObject_GC_Track(o);
21568  } else {
21569  o = (*t->tp_alloc)(t, 0);
21570  if (unlikely(!o)) return 0;
21571  }
21572  return o;
21573 }
21574 
21575 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o) {
21576  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
21577  PyObject_GC_UnTrack(o);
21578  Py_CLEAR(p->__pyx_v_a);
21579  Py_CLEAR(p->__pyx_v_a0);
21580  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC)))) {
21581  __pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC++] = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o);
21582  } else {
21583  (*Py_TYPE(o)->tp_free)(o);
21584  }
21585 }
21586 
21587 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o, visitproc v, void *a) {
21588  int e;
21589  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
21590  if (p->__pyx_v_a) {
21591  e = (*v)(p->__pyx_v_a, a); if (e) return e;
21592  }
21593  if (p->__pyx_v_a0) {
21594  e = (*v)(p->__pyx_v_a0, a); if (e) return e;
21595  }
21596  return 0;
21597 }
21598 
21599 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o) {
21600  PyObject* tmp;
21601  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
21602  tmp = ((PyObject*)p->__pyx_v_a);
21603  p->__pyx_v_a = Py_None; Py_INCREF(Py_None);
21604  Py_XDECREF(tmp);
21605  tmp = ((PyObject*)p->__pyx_v_a0);
21606  p->__pyx_v_a0 = Py_None; Py_INCREF(Py_None);
21607  Py_XDECREF(tmp);
21608  return 0;
21609 }
21610 
21611 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = {
21612  PyVarObject_HEAD_INIT(0, 0)
21613  "BoundaryConditions.__pyx_scope_struct_1_setLinearBC", /*tp_name*/
21614  sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC), /*tp_basicsize*/
21615  0, /*tp_itemsize*/
21616  __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, /*tp_dealloc*/
21617  #if PY_VERSION_HEX < 0x030800b4
21618  0, /*tp_print*/
21619  #endif
21620  #if PY_VERSION_HEX >= 0x030800b4
21621  0, /*tp_vectorcall_offset*/
21622  #endif
21623  0, /*tp_getattr*/
21624  0, /*tp_setattr*/
21625  #if PY_MAJOR_VERSION < 3
21626  0, /*tp_compare*/
21627  #endif
21628  #if PY_MAJOR_VERSION >= 3
21629  0, /*tp_as_async*/
21630  #endif
21631  0, /*tp_repr*/
21632  0, /*tp_as_number*/
21633  0, /*tp_as_sequence*/
21634  0, /*tp_as_mapping*/
21635  0, /*tp_hash*/
21636  0, /*tp_call*/
21637  0, /*tp_str*/
21638  0, /*tp_getattro*/
21639  0, /*tp_setattro*/
21640  0, /*tp_as_buffer*/
21641  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21642  0, /*tp_doc*/
21643  __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, /*tp_traverse*/
21644  __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, /*tp_clear*/
21645  0, /*tp_richcompare*/
21646  0, /*tp_weaklistoffset*/
21647  0, /*tp_iter*/
21648  0, /*tp_iternext*/
21649  0, /*tp_methods*/
21650  0, /*tp_members*/
21651  0, /*tp_getset*/
21652  0, /*tp_base*/
21653  0, /*tp_dict*/
21654  0, /*tp_descr_get*/
21655  0, /*tp_descr_set*/
21656  0, /*tp_dictoffset*/
21657  0, /*tp_init*/
21658  0, /*tp_alloc*/
21659  __pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, /*tp_new*/
21660  0, /*tp_free*/
21661  0, /*tp_is_gc*/
21662  0, /*tp_bases*/
21663  0, /*tp_mro*/
21664  0, /*tp_cache*/
21665  0, /*tp_subclasses*/
21666  0, /*tp_weaklist*/
21667  0, /*tp_del*/
21668  0, /*tp_version_tag*/
21669  #if PY_VERSION_HEX >= 0x030400a1
21670  0, /*tp_finalize*/
21671  #endif
21672  #if PY_VERSION_HEX >= 0x030800b1
21673  0, /*tp_vectorcall*/
21674  #endif
21675  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21676  0, /*tp_print*/
21677  #endif
21678 };
21679 
21680 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[8];
21681 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = 0;
21682 
21683 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21684  PyObject *o;
21685  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp)))) {
21686  o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp];
21687  memset(o, 0, sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp));
21688  (void) PyObject_INIT(o, t);
21689  PyObject_GC_Track(o);
21690  } else {
21691  o = (*t->tp_alloc)(t, 0);
21692  if (unlikely(!o)) return 0;
21693  }
21694  return o;
21695 }
21696 
21697 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o) {
21698  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
21699  PyObject_GC_UnTrack(o);
21700  Py_CLEAR(p->__pyx_v_t1);
21701  Py_CLEAR(p->__pyx_v_value);
21702  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp)))) {
21703  __pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp++] = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o);
21704  } else {
21705  (*Py_TYPE(o)->tp_free)(o);
21706  }
21707 }
21708 
21709 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o, visitproc v, void *a) {
21710  int e;
21711  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
21712  if (p->__pyx_v_t1) {
21713  e = (*v)(p->__pyx_v_t1, a); if (e) return e;
21714  }
21715  if (p->__pyx_v_value) {
21716  e = (*v)(p->__pyx_v_value, a); if (e) return e;
21717  }
21718  return 0;
21719 }
21720 
21721 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o) {
21722  PyObject* tmp;
21723  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
21724  tmp = ((PyObject*)p->__pyx_v_t1);
21725  p->__pyx_v_t1 = Py_None; Py_INCREF(Py_None);
21726  Py_XDECREF(tmp);
21727  tmp = ((PyObject*)p->__pyx_v_value);
21728  p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
21729  Py_XDECREF(tmp);
21730  return 0;
21731 }
21732 
21733 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = {
21734  PyVarObject_HEAD_INIT(0, 0)
21735  "BoundaryConditions.__pyx_scope_struct_2_setLinearRamp", /*tp_name*/
21736  sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp), /*tp_basicsize*/
21737  0, /*tp_itemsize*/
21738  __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, /*tp_dealloc*/
21739  #if PY_VERSION_HEX < 0x030800b4
21740  0, /*tp_print*/
21741  #endif
21742  #if PY_VERSION_HEX >= 0x030800b4
21743  0, /*tp_vectorcall_offset*/
21744  #endif
21745  0, /*tp_getattr*/
21746  0, /*tp_setattr*/
21747  #if PY_MAJOR_VERSION < 3
21748  0, /*tp_compare*/
21749  #endif
21750  #if PY_MAJOR_VERSION >= 3
21751  0, /*tp_as_async*/
21752  #endif
21753  0, /*tp_repr*/
21754  0, /*tp_as_number*/
21755  0, /*tp_as_sequence*/
21756  0, /*tp_as_mapping*/
21757  0, /*tp_hash*/
21758  0, /*tp_call*/
21759  0, /*tp_str*/
21760  0, /*tp_getattro*/
21761  0, /*tp_setattro*/
21762  0, /*tp_as_buffer*/
21763  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21764  0, /*tp_doc*/
21765  __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, /*tp_traverse*/
21766  __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, /*tp_clear*/
21767  0, /*tp_richcompare*/
21768  0, /*tp_weaklistoffset*/
21769  0, /*tp_iter*/
21770  0, /*tp_iternext*/
21771  0, /*tp_methods*/
21772  0, /*tp_members*/
21773  0, /*tp_getset*/
21774  0, /*tp_base*/
21775  0, /*tp_dict*/
21776  0, /*tp_descr_get*/
21777  0, /*tp_descr_set*/
21778  0, /*tp_dictoffset*/
21779  0, /*tp_init*/
21780  0, /*tp_alloc*/
21781  __pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, /*tp_new*/
21782  0, /*tp_free*/
21783  0, /*tp_is_gc*/
21784  0, /*tp_bases*/
21785  0, /*tp_mro*/
21786  0, /*tp_cache*/
21787  0, /*tp_subclasses*/
21788  0, /*tp_weaklist*/
21789  0, /*tp_del*/
21790  0, /*tp_version_tag*/
21791  #if PY_VERSION_HEX >= 0x030400a1
21792  0, /*tp_finalize*/
21793  #endif
21794  #if PY_VERSION_HEX >= 0x030800b1
21795  0, /*tp_vectorcall*/
21796  #endif
21797  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21798  0, /*tp_print*/
21799  #endif
21800 };
21801 static struct __pyx_vtabstruct_array __pyx_vtable_array;
21802 
21803 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
21804  struct __pyx_array_obj *p;
21805  PyObject *o;
21806  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21807  o = (*t->tp_alloc)(t, 0);
21808  } else {
21809  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21810  }
21811  if (unlikely(!o)) return 0;
21812  p = ((struct __pyx_array_obj *)o);
21813  p->__pyx_vtab = __pyx_vtabptr_array;
21814  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
21815  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
21816  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
21817  return o;
21818  bad:
21819  Py_DECREF(o); o = 0;
21820  return NULL;
21821 }
21822 
21823 static void __pyx_tp_dealloc_array(PyObject *o) {
21824  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
21825  #if CYTHON_USE_TP_FINALIZE
21826  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21827  if (PyObject_CallFinalizerFromDealloc(o)) return;
21828  }
21829  #endif
21830  {
21831  PyObject *etype, *eval, *etb;
21832  PyErr_Fetch(&etype, &eval, &etb);
21833  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21834  __pyx_array___dealloc__(o);
21835  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21836  PyErr_Restore(etype, eval, etb);
21837  }
21838  Py_CLEAR(p->mode);
21839  Py_CLEAR(p->_format);
21840  (*Py_TYPE(o)->tp_free)(o);
21841 }
21842 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21843  PyObject *r;
21844  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21845  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21846  Py_DECREF(x);
21847  return r;
21848 }
21849 
21850 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
21851  if (v) {
21852  return __pyx_array___setitem__(o, i, v);
21853  }
21854  else {
21855  PyErr_Format(PyExc_NotImplementedError,
21856  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21857  return -1;
21858  }
21859 }
21860 
21861 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
21862  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
21863  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21864  PyErr_Clear();
21865  v = __pyx_array___getattr__(o, n);
21866  }
21867  return v;
21868 }
21869 
21870 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
21871  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
21872 }
21873 
21874 static PyMethodDef __pyx_methods_array[] = {
21875  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
21876  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
21877  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
21878  {0, 0, 0, 0}
21879 };
21880 
21881 static struct PyGetSetDef __pyx_getsets_array[] = {
21882  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
21883  {0, 0, 0, 0, 0}
21884 };
21885 
21886 static PySequenceMethods __pyx_tp_as_sequence_array = {
21887  __pyx_array___len__, /*sq_length*/
21888  0, /*sq_concat*/
21889  0, /*sq_repeat*/
21890  __pyx_sq_item_array, /*sq_item*/
21891  0, /*sq_slice*/
21892  0, /*sq_ass_item*/
21893  0, /*sq_ass_slice*/
21894  0, /*sq_contains*/
21895  0, /*sq_inplace_concat*/
21896  0, /*sq_inplace_repeat*/
21897 };
21898 
21899 static PyMappingMethods __pyx_tp_as_mapping_array = {
21900  __pyx_array___len__, /*mp_length*/
21901  __pyx_array___getitem__, /*mp_subscript*/
21902  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
21903 };
21904 
21905 static PyBufferProcs __pyx_tp_as_buffer_array = {
21906  #if PY_MAJOR_VERSION < 3
21907  0, /*bf_getreadbuffer*/
21908  #endif
21909  #if PY_MAJOR_VERSION < 3
21910  0, /*bf_getwritebuffer*/
21911  #endif
21912  #if PY_MAJOR_VERSION < 3
21913  0, /*bf_getsegcount*/
21914  #endif
21915  #if PY_MAJOR_VERSION < 3
21916  0, /*bf_getcharbuffer*/
21917  #endif
21918  __pyx_array_getbuffer, /*bf_getbuffer*/
21919  0, /*bf_releasebuffer*/
21920 };
21921 
21922 static PyTypeObject __pyx_type___pyx_array = {
21923  PyVarObject_HEAD_INIT(0, 0)
21924  "BoundaryConditions.array", /*tp_name*/
21925  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
21926  0, /*tp_itemsize*/
21927  __pyx_tp_dealloc_array, /*tp_dealloc*/
21928  #if PY_VERSION_HEX < 0x030800b4
21929  0, /*tp_print*/
21930  #endif
21931  #if PY_VERSION_HEX >= 0x030800b4
21932  0, /*tp_vectorcall_offset*/
21933  #endif
21934  0, /*tp_getattr*/
21935  0, /*tp_setattr*/
21936  #if PY_MAJOR_VERSION < 3
21937  0, /*tp_compare*/
21938  #endif
21939  #if PY_MAJOR_VERSION >= 3
21940  0, /*tp_as_async*/
21941  #endif
21942  0, /*tp_repr*/
21943  0, /*tp_as_number*/
21944  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
21945  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
21946  0, /*tp_hash*/
21947  0, /*tp_call*/
21948  0, /*tp_str*/
21949  __pyx_tp_getattro_array, /*tp_getattro*/
21950  0, /*tp_setattro*/
21951  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
21952  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21953  0, /*tp_doc*/
21954  0, /*tp_traverse*/
21955  0, /*tp_clear*/
21956  0, /*tp_richcompare*/
21957  0, /*tp_weaklistoffset*/
21958  0, /*tp_iter*/
21959  0, /*tp_iternext*/
21960  __pyx_methods_array, /*tp_methods*/
21961  0, /*tp_members*/
21962  __pyx_getsets_array, /*tp_getset*/
21963  0, /*tp_base*/
21964  0, /*tp_dict*/
21965  0, /*tp_descr_get*/
21966  0, /*tp_descr_set*/
21967  0, /*tp_dictoffset*/
21968  0, /*tp_init*/
21969  0, /*tp_alloc*/
21970  __pyx_tp_new_array, /*tp_new*/
21971  0, /*tp_free*/
21972  0, /*tp_is_gc*/
21973  0, /*tp_bases*/
21974  0, /*tp_mro*/
21975  0, /*tp_cache*/
21976  0, /*tp_subclasses*/
21977  0, /*tp_weaklist*/
21978  0, /*tp_del*/
21979  0, /*tp_version_tag*/
21980  #if PY_VERSION_HEX >= 0x030400a1
21981  0, /*tp_finalize*/
21982  #endif
21983  #if PY_VERSION_HEX >= 0x030800b1
21984  0, /*tp_vectorcall*/
21985  #endif
21986  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21987  0, /*tp_print*/
21988  #endif
21989 };
21990 
21991 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21992  struct __pyx_MemviewEnum_obj *p;
21993  PyObject *o;
21994  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21995  o = (*t->tp_alloc)(t, 0);
21996  } else {
21997  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21998  }
21999  if (unlikely(!o)) return 0;
22000  p = ((struct __pyx_MemviewEnum_obj *)o);
22001  p->name = Py_None; Py_INCREF(Py_None);
22002  return o;
22003 }
22004 
22005 static void __pyx_tp_dealloc_Enum(PyObject *o) {
22006  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22007  #if CYTHON_USE_TP_FINALIZE
22008  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22009  if (PyObject_CallFinalizerFromDealloc(o)) return;
22010  }
22011  #endif
22012  PyObject_GC_UnTrack(o);
22013  Py_CLEAR(p->name);
22014  (*Py_TYPE(o)->tp_free)(o);
22015 }
22016 
22017 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
22018  int e;
22019  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22020  if (p->name) {
22021  e = (*v)(p->name, a); if (e) return e;
22022  }
22023  return 0;
22024 }
22025 
22026 static int __pyx_tp_clear_Enum(PyObject *o) {
22027  PyObject* tmp;
22028  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22029  tmp = ((PyObject*)p->name);
22030  p->name = Py_None; Py_INCREF(Py_None);
22031  Py_XDECREF(tmp);
22032  return 0;
22033 }
22034 
22035 static PyMethodDef __pyx_methods_Enum[] = {
22036  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
22037  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
22038  {0, 0, 0, 0}
22039 };
22040 
22041 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
22042  PyVarObject_HEAD_INIT(0, 0)
22043  "BoundaryConditions.Enum", /*tp_name*/
22044  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
22045  0, /*tp_itemsize*/
22046  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
22047  #if PY_VERSION_HEX < 0x030800b4
22048  0, /*tp_print*/
22049  #endif
22050  #if PY_VERSION_HEX >= 0x030800b4
22051  0, /*tp_vectorcall_offset*/
22052  #endif
22053  0, /*tp_getattr*/
22054  0, /*tp_setattr*/
22055  #if PY_MAJOR_VERSION < 3
22056  0, /*tp_compare*/
22057  #endif
22058  #if PY_MAJOR_VERSION >= 3
22059  0, /*tp_as_async*/
22060  #endif
22061  __pyx_MemviewEnum___repr__, /*tp_repr*/
22062  0, /*tp_as_number*/
22063  0, /*tp_as_sequence*/
22064  0, /*tp_as_mapping*/
22065  0, /*tp_hash*/
22066  0, /*tp_call*/
22067  0, /*tp_str*/
22068  0, /*tp_getattro*/
22069  0, /*tp_setattro*/
22070  0, /*tp_as_buffer*/
22071  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22072  0, /*tp_doc*/
22073  __pyx_tp_traverse_Enum, /*tp_traverse*/
22074  __pyx_tp_clear_Enum, /*tp_clear*/
22075  0, /*tp_richcompare*/
22076  0, /*tp_weaklistoffset*/
22077  0, /*tp_iter*/
22078  0, /*tp_iternext*/
22079  __pyx_methods_Enum, /*tp_methods*/
22080  0, /*tp_members*/
22081  0, /*tp_getset*/
22082  0, /*tp_base*/
22083  0, /*tp_dict*/
22084  0, /*tp_descr_get*/
22085  0, /*tp_descr_set*/
22086  0, /*tp_dictoffset*/
22087  __pyx_MemviewEnum___init__, /*tp_init*/
22088  0, /*tp_alloc*/
22089  __pyx_tp_new_Enum, /*tp_new*/
22090  0, /*tp_free*/
22091  0, /*tp_is_gc*/
22092  0, /*tp_bases*/
22093  0, /*tp_mro*/
22094  0, /*tp_cache*/
22095  0, /*tp_subclasses*/
22096  0, /*tp_weaklist*/
22097  0, /*tp_del*/
22098  0, /*tp_version_tag*/
22099  #if PY_VERSION_HEX >= 0x030400a1
22100  0, /*tp_finalize*/
22101  #endif
22102  #if PY_VERSION_HEX >= 0x030800b1
22103  0, /*tp_vectorcall*/
22104  #endif
22105  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22106  0, /*tp_print*/
22107  #endif
22108 };
22109 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
22110 
22111 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
22112  struct __pyx_memoryview_obj *p;
22113  PyObject *o;
22114  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22115  o = (*t->tp_alloc)(t, 0);
22116  } else {
22117  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22118  }
22119  if (unlikely(!o)) return 0;
22120  p = ((struct __pyx_memoryview_obj *)o);
22121  p->__pyx_vtab = __pyx_vtabptr_memoryview;
22122  p->obj = Py_None; Py_INCREF(Py_None);
22123  p->_size = Py_None; Py_INCREF(Py_None);
22124  p->_array_interface = Py_None; Py_INCREF(Py_None);
22125  p->view.obj = NULL;
22126  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
22127  return o;
22128  bad:
22129  Py_DECREF(o); o = 0;
22130  return NULL;
22131 }
22132 
22133 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
22134  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22135  #if CYTHON_USE_TP_FINALIZE
22136  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22137  if (PyObject_CallFinalizerFromDealloc(o)) return;
22138  }
22139  #endif
22140  PyObject_GC_UnTrack(o);
22141  {
22142  PyObject *etype, *eval, *etb;
22143  PyErr_Fetch(&etype, &eval, &etb);
22144  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
22145  __pyx_memoryview___dealloc__(o);
22146  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
22147  PyErr_Restore(etype, eval, etb);
22148  }
22149  Py_CLEAR(p->obj);
22150  Py_CLEAR(p->_size);
22151  Py_CLEAR(p->_array_interface);
22152  (*Py_TYPE(o)->tp_free)(o);
22153 }
22154 
22155 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
22156  int e;
22157  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22158  if (p->obj) {
22159  e = (*v)(p->obj, a); if (e) return e;
22160  }
22161  if (p->_size) {
22162  e = (*v)(p->_size, a); if (e) return e;
22163  }
22164  if (p->_array_interface) {
22165  e = (*v)(p->_array_interface, a); if (e) return e;
22166  }
22167  if (p->view.obj) {
22168  e = (*v)(p->view.obj, a); if (e) return e;
22169  }
22170  return 0;
22171 }
22172 
22173 static int __pyx_tp_clear_memoryview(PyObject *o) {
22174  PyObject* tmp;
22175  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22176  tmp = ((PyObject*)p->obj);
22177  p->obj = Py_None; Py_INCREF(Py_None);
22178  Py_XDECREF(tmp);
22179  tmp = ((PyObject*)p->_size);
22180  p->_size = Py_None; Py_INCREF(Py_None);
22181  Py_XDECREF(tmp);
22182  tmp = ((PyObject*)p->_array_interface);
22183  p->_array_interface = Py_None; Py_INCREF(Py_None);
22184  Py_XDECREF(tmp);
22185  Py_CLEAR(p->view.obj);
22186  return 0;
22187 }
22188 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
22189  PyObject *r;
22190  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
22191  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22192  Py_DECREF(x);
22193  return r;
22194 }
22195 
22196 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
22197  if (v) {
22198  return __pyx_memoryview___setitem__(o, i, v);
22199  }
22200  else {
22201  PyErr_Format(PyExc_NotImplementedError,
22202  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22203  return -1;
22204  }
22205 }
22206 
22207 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
22208  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
22209 }
22210 
22211 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
22212  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
22213 }
22214 
22215 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
22216  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
22217 }
22218 
22219 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
22220  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
22221 }
22222 
22223 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
22224  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
22225 }
22226 
22227 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
22228  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
22229 }
22230 
22231 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
22232  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
22233 }
22234 
22235 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
22236  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
22237 }
22238 
22239 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
22240  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
22241 }
22242 
22243 static PyMethodDef __pyx_methods_memoryview[] = {
22244  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
22245  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
22246  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
22247  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
22248  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
22249  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
22250  {0, 0, 0, 0}
22251 };
22252 
22253 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
22254  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
22255  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
22256  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
22257  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
22258  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
22259  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
22260  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
22261  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
22262  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
22263  {0, 0, 0, 0, 0}
22264 };
22265 
22266 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
22267  __pyx_memoryview___len__, /*sq_length*/
22268  0, /*sq_concat*/
22269  0, /*sq_repeat*/
22270  __pyx_sq_item_memoryview, /*sq_item*/
22271  0, /*sq_slice*/
22272  0, /*sq_ass_item*/
22273  0, /*sq_ass_slice*/
22274  0, /*sq_contains*/
22275  0, /*sq_inplace_concat*/
22276  0, /*sq_inplace_repeat*/
22277 };
22278 
22279 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
22280  __pyx_memoryview___len__, /*mp_length*/
22281  __pyx_memoryview___getitem__, /*mp_subscript*/
22282  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
22283 };
22284 
22285 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
22286  #if PY_MAJOR_VERSION < 3
22287  0, /*bf_getreadbuffer*/
22288  #endif
22289  #if PY_MAJOR_VERSION < 3
22290  0, /*bf_getwritebuffer*/
22291  #endif
22292  #if PY_MAJOR_VERSION < 3
22293  0, /*bf_getsegcount*/
22294  #endif
22295  #if PY_MAJOR_VERSION < 3
22296  0, /*bf_getcharbuffer*/
22297  #endif
22298  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
22299  0, /*bf_releasebuffer*/
22300 };
22301 
22302 static PyTypeObject __pyx_type___pyx_memoryview = {
22303  PyVarObject_HEAD_INIT(0, 0)
22304  "BoundaryConditions.memoryview", /*tp_name*/
22305  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
22306  0, /*tp_itemsize*/
22307  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
22308  #if PY_VERSION_HEX < 0x030800b4
22309  0, /*tp_print*/
22310  #endif
22311  #if PY_VERSION_HEX >= 0x030800b4
22312  0, /*tp_vectorcall_offset*/
22313  #endif
22314  0, /*tp_getattr*/
22315  0, /*tp_setattr*/
22316  #if PY_MAJOR_VERSION < 3
22317  0, /*tp_compare*/
22318  #endif
22319  #if PY_MAJOR_VERSION >= 3
22320  0, /*tp_as_async*/
22321  #endif
22322  __pyx_memoryview___repr__, /*tp_repr*/
22323  0, /*tp_as_number*/
22324  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
22325  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
22326  0, /*tp_hash*/
22327  0, /*tp_call*/
22328  __pyx_memoryview___str__, /*tp_str*/
22329  0, /*tp_getattro*/
22330  0, /*tp_setattro*/
22331  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
22332  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22333  0, /*tp_doc*/
22334  __pyx_tp_traverse_memoryview, /*tp_traverse*/
22335  __pyx_tp_clear_memoryview, /*tp_clear*/
22336  0, /*tp_richcompare*/
22337  0, /*tp_weaklistoffset*/
22338  0, /*tp_iter*/
22339  0, /*tp_iternext*/
22340  __pyx_methods_memoryview, /*tp_methods*/
22341  0, /*tp_members*/
22342  __pyx_getsets_memoryview, /*tp_getset*/
22343  0, /*tp_base*/
22344  0, /*tp_dict*/
22345  0, /*tp_descr_get*/
22346  0, /*tp_descr_set*/
22347  0, /*tp_dictoffset*/
22348  0, /*tp_init*/
22349  0, /*tp_alloc*/
22350  __pyx_tp_new_memoryview, /*tp_new*/
22351  0, /*tp_free*/
22352  0, /*tp_is_gc*/
22353  0, /*tp_bases*/
22354  0, /*tp_mro*/
22355  0, /*tp_cache*/
22356  0, /*tp_subclasses*/
22357  0, /*tp_weaklist*/
22358  0, /*tp_del*/
22359  0, /*tp_version_tag*/
22360  #if PY_VERSION_HEX >= 0x030400a1
22361  0, /*tp_finalize*/
22362  #endif
22363  #if PY_VERSION_HEX >= 0x030800b1
22364  0, /*tp_vectorcall*/
22365  #endif
22366  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22367  0, /*tp_print*/
22368  #endif
22369 };
22370 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
22371 
22372 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
22373  struct __pyx_memoryviewslice_obj *p;
22374  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
22375  if (unlikely(!o)) return 0;
22376  p = ((struct __pyx_memoryviewslice_obj *)o);
22377  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
22378  p->from_object = Py_None; Py_INCREF(Py_None);
22379  p->from_slice.memview = NULL;
22380  return o;
22381 }
22382 
22383 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
22384  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22385  #if CYTHON_USE_TP_FINALIZE
22386  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22387  if (PyObject_CallFinalizerFromDealloc(o)) return;
22388  }
22389  #endif
22390  PyObject_GC_UnTrack(o);
22391  {
22392  PyObject *etype, *eval, *etb;
22393  PyErr_Fetch(&etype, &eval, &etb);
22394  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
22395  __pyx_memoryviewslice___dealloc__(o);
22396  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
22397  PyErr_Restore(etype, eval, etb);
22398  }
22399  Py_CLEAR(p->from_object);
22400  PyObject_GC_Track(o);
22401  __pyx_tp_dealloc_memoryview(o);
22402 }
22403 
22404 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
22405  int e;
22406  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22407  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
22408  if (p->from_object) {
22409  e = (*v)(p->from_object, a); if (e) return e;
22410  }
22411  return 0;
22412 }
22413 
22414 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
22415  PyObject* tmp;
22416  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22417  __pyx_tp_clear_memoryview(o);
22418  tmp = ((PyObject*)p->from_object);
22419  p->from_object = Py_None; Py_INCREF(Py_None);
22420  Py_XDECREF(tmp);
22421  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
22422  return 0;
22423 }
22424 
22425 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
22426  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
22427 }
22428 
22429 static PyMethodDef __pyx_methods__memoryviewslice[] = {
22430  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
22431  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
22432  {0, 0, 0, 0}
22433 };
22434 
22435 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
22436  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
22437  {0, 0, 0, 0, 0}
22438 };
22439 
22440 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22441  PyVarObject_HEAD_INIT(0, 0)
22442  "BoundaryConditions._memoryviewslice", /*tp_name*/
22443  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
22444  0, /*tp_itemsize*/
22445  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
22446  #if PY_VERSION_HEX < 0x030800b4
22447  0, /*tp_print*/
22448  #endif
22449  #if PY_VERSION_HEX >= 0x030800b4
22450  0, /*tp_vectorcall_offset*/
22451  #endif
22452  0, /*tp_getattr*/
22453  0, /*tp_setattr*/
22454  #if PY_MAJOR_VERSION < 3
22455  0, /*tp_compare*/
22456  #endif
22457  #if PY_MAJOR_VERSION >= 3
22458  0, /*tp_as_async*/
22459  #endif
22460  #if CYTHON_COMPILING_IN_PYPY
22461  __pyx_memoryview___repr__, /*tp_repr*/
22462  #else
22463  0, /*tp_repr*/
22464  #endif
22465  0, /*tp_as_number*/
22466  0, /*tp_as_sequence*/
22467  0, /*tp_as_mapping*/
22468  0, /*tp_hash*/
22469  0, /*tp_call*/
22470  #if CYTHON_COMPILING_IN_PYPY
22471  __pyx_memoryview___str__, /*tp_str*/
22472  #else
22473  0, /*tp_str*/
22474  #endif
22475  0, /*tp_getattro*/
22476  0, /*tp_setattro*/
22477  0, /*tp_as_buffer*/
22478  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22479  "Internal class for passing memoryview slices to Python", /*tp_doc*/
22480  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
22481  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
22482  0, /*tp_richcompare*/
22483  0, /*tp_weaklistoffset*/
22484  0, /*tp_iter*/
22485  0, /*tp_iternext*/
22486  __pyx_methods__memoryviewslice, /*tp_methods*/
22487  0, /*tp_members*/
22488  __pyx_getsets__memoryviewslice, /*tp_getset*/
22489  0, /*tp_base*/
22490  0, /*tp_dict*/
22491  0, /*tp_descr_get*/
22492  0, /*tp_descr_set*/
22493  0, /*tp_dictoffset*/
22494  0, /*tp_init*/
22495  0, /*tp_alloc*/
22496  __pyx_tp_new__memoryviewslice, /*tp_new*/
22497  0, /*tp_free*/
22498  0, /*tp_is_gc*/
22499  0, /*tp_bases*/
22500  0, /*tp_mro*/
22501  0, /*tp_cache*/
22502  0, /*tp_subclasses*/
22503  0, /*tp_weaklist*/
22504  0, /*tp_del*/
22505  0, /*tp_version_tag*/
22506  #if PY_VERSION_HEX >= 0x030400a1
22507  0, /*tp_finalize*/
22508  #endif
22509  #if PY_VERSION_HEX >= 0x030800b1
22510  0, /*tp_vectorcall*/
22511  #endif
22512  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22513  0, /*tp_print*/
22514  #endif
22515 };
22516 
22517 static PyMethodDef __pyx_methods[] = {
22518  {0, 0, 0, 0}
22519 };
22520 
22521 #if PY_MAJOR_VERSION >= 3
22522 #if CYTHON_PEP489_MULTI_PHASE_INIT
22523 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
22524 static int __pyx_pymod_exec_BoundaryConditions(PyObject* module); /*proto*/
22525 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22526  {Py_mod_create, (void*)__pyx_pymod_create},
22527  {Py_mod_exec, (void*)__pyx_pymod_exec_BoundaryConditions},
22528  {0, NULL}
22529 };
22530 #endif
22531 
22532 static struct PyModuleDef __pyx_moduledef = {
22533  PyModuleDef_HEAD_INIT,
22534  "BoundaryConditions",
22535  0, /* m_doc */
22536  #if CYTHON_PEP489_MULTI_PHASE_INIT
22537  0, /* m_size */
22538  #else
22539  -1, /* m_size */
22540  #endif
22541  __pyx_methods /* m_methods */,
22542  #if CYTHON_PEP489_MULTI_PHASE_INIT
22543  __pyx_moduledef_slots, /* m_slots */
22544  #else
22545  NULL, /* m_reload */
22546  #endif
22547  NULL, /* m_traverse */
22548  NULL, /* m_clear */
22549  NULL /* m_free */
22550 };
22551 #endif
22552 #ifndef CYTHON_SMALL_CODE
22553 #if defined(__clang__)
22554  #define CYTHON_SMALL_CODE
22555 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
22556  #define CYTHON_SMALL_CODE __attribute__((cold))
22557 #else
22558  #define CYTHON_SMALL_CODE
22559 #endif
22560 #endif
22561 
22562 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22563  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
22564  {&__pyx_n_s_BC_Base, __pyx_k_BC_Base, sizeof(__pyx_k_BC_Base), 0, 0, 1, 1},
22565  {&__pyx_n_s_BC_Base___reduce_cython, __pyx_k_BC_Base___reduce_cython, sizeof(__pyx_k_BC_Base___reduce_cython), 0, 0, 1, 1},
22566  {&__pyx_n_s_BC_Base___setstate_cython, __pyx_k_BC_Base___setstate_cython, sizeof(__pyx_k_BC_Base___setstate_cython), 0, 0, 1, 1},
22567  {&__pyx_n_s_BC_Base_getContext, __pyx_k_BC_Base_getContext, sizeof(__pyx_k_BC_Base_getContext), 0, 0, 1, 1},
22568  {&__pyx_n_s_BoundaryCondition, __pyx_k_BoundaryCondition, sizeof(__pyx_k_BoundaryCondition), 0, 0, 1, 1},
22569  {&__pyx_n_s_BoundaryCondition___reduce_cytho, __pyx_k_BoundaryCondition___reduce_cytho, sizeof(__pyx_k_BoundaryCondition___reduce_cytho), 0, 0, 1, 1},
22570  {&__pyx_n_s_BoundaryCondition___setstate_cyt, __pyx_k_BoundaryCondition___setstate_cyt, sizeof(__pyx_k_BoundaryCondition___setstate_cyt), 0, 0, 1, 1},
22571  {&__pyx_n_s_BoundaryCondition_init_cython, __pyx_k_BoundaryCondition_init_cython, sizeof(__pyx_k_BoundaryCondition_init_cython), 0, 0, 1, 1},
22572  {&__pyx_n_s_BoundaryCondition_resetBC, __pyx_k_BoundaryCondition_resetBC, sizeof(__pyx_k_BoundaryCondition_resetBC), 0, 0, 1, 1},
22573  {&__pyx_n_s_BoundaryCondition_setConstantBC, __pyx_k_BoundaryCondition_setConstantBC, sizeof(__pyx_k_BoundaryCondition_setConstantBC), 0, 0, 1, 1},
22574  {&__pyx_n_s_BoundaryCondition_setLinearBC, __pyx_k_BoundaryCondition_setLinearBC, sizeof(__pyx_k_BoundaryCondition_setLinearBC), 0, 0, 1, 1},
22575  {&__pyx_n_s_BoundaryCondition_setLinearRamp, __pyx_k_BoundaryCondition_setLinearRamp, sizeof(__pyx_k_BoundaryCondition_setLinearRamp), 0, 0, 1, 1},
22576  {&__pyx_n_s_BoundaryConditions, __pyx_k_BoundaryConditions, sizeof(__pyx_k_BoundaryConditions), 0, 0, 1, 1},
22577  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
22578  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
22579  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
22580  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
22581  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
22582  {&__pyx_n_s_Context, __pyx_k_Context, sizeof(__pyx_k_Context), 0, 0, 1, 1},
22583  {&__pyx_n_s_Domain, __pyx_k_Domain, sizeof(__pyx_k_Domain), 0, 0, 1, 1},
22584  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22585  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
22586  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22587  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x96, __pyx_k_Incompatible_checksums_s_vs_0x96, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x96), 0, 0, 1, 0},
22588  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
22589  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22590  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22591  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
22592  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
22593  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22594  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
22595  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22596  {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1},
22597  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
22598  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
22599  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22600  {&__pyx_kp_s_Shape_or_nd_must_be_passed_to_BC, __pyx_k_Shape_or_nd_must_be_passed_to_BC, sizeof(__pyx_k_Shape_or_nd_must_be_passed_to_BC), 0, 0, 1, 0},
22601  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22602  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
22603  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22604  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22605  {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
22606  {&__pyx_n_s_a0, __pyx_k_a0, sizeof(__pyx_k_a0), 0, 0, 1, 1},
22607  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
22608  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22609  {&__pyx_n_s_b_i, __pyx_k_b_i, sizeof(__pyx_k_b_i), 0, 0, 1, 1},
22610  {&__pyx_n_s_b_or, __pyx_k_b_or, sizeof(__pyx_k_b_or), 0, 0, 1, 1},
22611  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
22612  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
22613  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
22614  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
22615  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22616  {&__pyx_n_s_context, __pyx_k_context, sizeof(__pyx_k_context), 0, 0, 1, 1},
22617  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22618  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22619  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
22620  {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
22621  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22622  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
22623  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22624  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
22625  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
22626  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
22627  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22628  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22629  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
22630  {&__pyx_n_s_getContext, __pyx_k_getContext, sizeof(__pyx_k_getContext), 0, 0, 1, 1},
22631  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22632  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
22633  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
22634  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
22635  {&__pyx_n_s_init_cython, __pyx_k_init_cython, sizeof(__pyx_k_init_cython), 0, 0, 1, 1},
22636  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22637  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
22638  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
22639  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
22640  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
22641  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
22642  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
22643  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22644  {&__pyx_n_s_nd, __pyx_k_nd, sizeof(__pyx_k_nd), 0, 0, 1, 1},
22645  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22646  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
22647  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
22648  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
22649  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22650  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
22651  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
22652  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
22653  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
22654  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22655  {&__pyx_n_s_proteus, __pyx_k_proteus, sizeof(__pyx_k_proteus), 0, 0, 1, 1},
22656  {&__pyx_kp_s_proteus_BoundaryConditions_py, __pyx_k_proteus_BoundaryConditions_py, sizeof(__pyx_k_proteus_BoundaryConditions_py), 0, 0, 1, 0},
22657  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22658  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22659  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22660  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22661  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22662  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22663  {&__pyx_n_s_pyx_unpickle_BC_Base, __pyx_k_pyx_unpickle_BC_Base, sizeof(__pyx_k_pyx_unpickle_BC_Base), 0, 0, 1, 1},
22664  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22665  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22666  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
22667  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22668  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22669  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22670  {&__pyx_n_s_resetBC, __pyx_k_resetBC, sizeof(__pyx_k_resetBC), 0, 0, 1, 1},
22671  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
22672  {&__pyx_kp_s_self_uuOfXT_cannot_be_converted, __pyx_k_self_uuOfXT_cannot_be_converted, sizeof(__pyx_k_self_uuOfXT_cannot_be_converted), 0, 0, 1, 0},
22673  {&__pyx_n_s_setConstantBC, __pyx_k_setConstantBC, sizeof(__pyx_k_setConstantBC), 0, 0, 1, 1},
22674  {&__pyx_n_s_setConstantBC_locals_lambda, __pyx_k_setConstantBC_locals_lambda, sizeof(__pyx_k_setConstantBC_locals_lambda), 0, 0, 1, 1},
22675  {&__pyx_n_s_setLinearBC, __pyx_k_setLinearBC, sizeof(__pyx_k_setLinearBC), 0, 0, 1, 1},
22676  {&__pyx_n_s_setLinearBC_locals_lambda, __pyx_k_setLinearBC_locals_lambda, sizeof(__pyx_k_setLinearBC_locals_lambda), 0, 0, 1, 1},
22677  {&__pyx_n_s_setLinearRamp, __pyx_k_setLinearRamp, sizeof(__pyx_k_setLinearRamp), 0, 0, 1, 1},
22678  {&__pyx_n_s_setLinearRamp_locals_lambda, __pyx_k_setLinearRamp_locals_lambda, sizeof(__pyx_k_setLinearRamp_locals_lambda), 0, 0, 1, 1},
22679  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22680  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22681  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
22682  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
22683  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
22684  {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
22685  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
22686  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
22687  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22688  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
22689  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22690  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22691  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
22692  {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
22693  {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
22694  {&__pyx_n_s_t1, __pyx_k_t1, sizeof(__pyx_k_t1), 0, 0, 1, 1},
22695  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
22696  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
22697  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
22698  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22699  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
22700  {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1},
22701  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
22702  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
22703  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
22704  {0, 0, 0, 0, 0, 0, 0}
22705 };
22706 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
22707  __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 113, __pyx_L1_error)
22708  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
22709  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(3, 945, __pyx_L1_error)
22710  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 133, __pyx_L1_error)
22711  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
22712  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
22713  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 180, __pyx_L1_error)
22714  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
22715  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
22716  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
22717  return 0;
22718  __pyx_L1_error:;
22719  return -1;
22720 }
22721 
22722 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
22723  __Pyx_RefNannyDeclarations
22724  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
22725 
22726  /* "BoundaryConditions.py":113
22727  * """
22728  *
22729  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:]) # <<<<<<<<<<<<<<
22730  *
22731  * def setLinearRamp(self,t1,value):
22732  */
22733  __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 113, __pyx_L1_error)
22734  __Pyx_GOTREF(__pyx_slice__7);
22735  __Pyx_GIVEREF(__pyx_slice__7);
22736 
22737  /* "(tree fragment)":2
22738  * def __reduce_cython__(self):
22739  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
22740  * def __setstate_cython__(self, __pyx_state):
22741  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
22742  */
22743  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_self_uuOfXT_cannot_be_converted); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 2, __pyx_L1_error)
22744  __Pyx_GOTREF(__pyx_tuple__11);
22745  __Pyx_GIVEREF(__pyx_tuple__11);
22746 
22747  /* "(tree fragment)":4
22748  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
22749  * def __setstate_cython__(self, __pyx_state):
22750  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
22751  */
22752  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_self_uuOfXT_cannot_be_converted); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 4, __pyx_L1_error)
22753  __Pyx_GOTREF(__pyx_tuple__13);
22754  __Pyx_GIVEREF(__pyx_tuple__13);
22755 
22756  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":945
22757  * __pyx_import_array()
22758  * except Exception:
22759  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
22760  *
22761  * cdef inline int import_umath() except -1:
22762  */
22763  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(3, 945, __pyx_L1_error)
22764  __Pyx_GOTREF(__pyx_tuple__15);
22765  __Pyx_GIVEREF(__pyx_tuple__15);
22766 
22767  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":951
22768  * _import_umath()
22769  * except Exception:
22770  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
22771  *
22772  * cdef inline int import_ufunc() except -1:
22773  */
22774  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(3, 951, __pyx_L1_error)
22775  __Pyx_GOTREF(__pyx_tuple__16);
22776  __Pyx_GIVEREF(__pyx_tuple__16);
22777 
22778  /* "View.MemoryView":133
22779  *
22780  * if not self.ndim:
22781  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
22782  *
22783  * if itemsize <= 0:
22784  */
22785  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 133, __pyx_L1_error)
22786  __Pyx_GOTREF(__pyx_tuple__17);
22787  __Pyx_GIVEREF(__pyx_tuple__17);
22788 
22789  /* "View.MemoryView":136
22790  *
22791  * if itemsize <= 0:
22792  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
22793  *
22794  * if not isinstance(format, bytes):
22795  */
22796  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 136, __pyx_L1_error)
22797  __Pyx_GOTREF(__pyx_tuple__18);
22798  __Pyx_GIVEREF(__pyx_tuple__18);
22799 
22800  /* "View.MemoryView":148
22801  *
22802  * if not self._shape:
22803  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
22804  *
22805  *
22806  */
22807  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 148, __pyx_L1_error)
22808  __Pyx_GOTREF(__pyx_tuple__19);
22809  __Pyx_GIVEREF(__pyx_tuple__19);
22810 
22811  /* "View.MemoryView":176
22812  * self.data = <char *>malloc(self.len)
22813  * if not self.data:
22814  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
22815  *
22816  * if self.dtype_is_object:
22817  */
22818  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 176, __pyx_L1_error)
22819  __Pyx_GOTREF(__pyx_tuple__20);
22820  __Pyx_GIVEREF(__pyx_tuple__20);
22821 
22822  /* "View.MemoryView":192
22823  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
22824  * if not (flags & bufmode):
22825  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
22826  * info.buf = self.data
22827  * info.len = self.len
22828  */
22829  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 192, __pyx_L1_error)
22830  __Pyx_GOTREF(__pyx_tuple__21);
22831  __Pyx_GIVEREF(__pyx_tuple__21);
22832 
22833  /* "(tree fragment)":2
22834  * def __reduce_cython__(self):
22835  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22836  * def __setstate_cython__(self, __pyx_state):
22837  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22838  */
22839  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 2, __pyx_L1_error)
22840  __Pyx_GOTREF(__pyx_tuple__22);
22841  __Pyx_GIVEREF(__pyx_tuple__22);
22842 
22843  /* "(tree fragment)":4
22844  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22845  * def __setstate_cython__(self, __pyx_state):
22846  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22847  */
22848  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 4, __pyx_L1_error)
22849  __Pyx_GOTREF(__pyx_tuple__23);
22850  __Pyx_GIVEREF(__pyx_tuple__23);
22851 
22852  /* "View.MemoryView":418
22853  * def __setitem__(memoryview self, object index, object value):
22854  * if self.view.readonly:
22855  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
22856  *
22857  * have_slices, index = _unellipsify(index, self.view.ndim)
22858  */
22859  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 418, __pyx_L1_error)
22860  __Pyx_GOTREF(__pyx_tuple__24);
22861  __Pyx_GIVEREF(__pyx_tuple__24);
22862 
22863  /* "View.MemoryView":495
22864  * result = struct.unpack(self.view.format, bytesitem)
22865  * except struct.error:
22866  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
22867  * else:
22868  * if len(self.view.format) == 1:
22869  */
22870  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 495, __pyx_L1_error)
22871  __Pyx_GOTREF(__pyx_tuple__25);
22872  __Pyx_GIVEREF(__pyx_tuple__25);
22873 
22874  /* "View.MemoryView":520
22875  * def __getbuffer__(self, Py_buffer *info, int flags):
22876  * if flags & PyBUF_WRITABLE and self.view.readonly:
22877  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
22878  *
22879  * if flags & PyBUF_ND:
22880  */
22881  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 520, __pyx_L1_error)
22882  __Pyx_GOTREF(__pyx_tuple__26);
22883  __Pyx_GIVEREF(__pyx_tuple__26);
22884 
22885  /* "View.MemoryView":570
22886  * if self.view.strides == NULL:
22887  *
22888  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
22889  *
22890  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
22891  */
22892  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 570, __pyx_L1_error)
22893  __Pyx_GOTREF(__pyx_tuple__27);
22894  __Pyx_GIVEREF(__pyx_tuple__27);
22895 
22896  /* "View.MemoryView":577
22897  * def suboffsets(self):
22898  * if self.view.suboffsets == NULL:
22899  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
22900  *
22901  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
22902  */
22903  __pyx_tuple__28 = PyTuple_New(1); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 577, __pyx_L1_error)
22904  __Pyx_GOTREF(__pyx_tuple__28);
22905  __Pyx_INCREF(__pyx_int_neg_1);
22906  __Pyx_GIVEREF(__pyx_int_neg_1);
22907  PyTuple_SET_ITEM(__pyx_tuple__28, 0, __pyx_int_neg_1);
22908  __Pyx_GIVEREF(__pyx_tuple__28);
22909 
22910  /* "(tree fragment)":2
22911  * def __reduce_cython__(self):
22912  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22913  * def __setstate_cython__(self, __pyx_state):
22914  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22915  */
22916  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 2, __pyx_L1_error)
22917  __Pyx_GOTREF(__pyx_tuple__29);
22918  __Pyx_GIVEREF(__pyx_tuple__29);
22919 
22920  /* "(tree fragment)":4
22921  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22922  * def __setstate_cython__(self, __pyx_state):
22923  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22924  */
22925  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 4, __pyx_L1_error)
22926  __Pyx_GOTREF(__pyx_tuple__30);
22927  __Pyx_GIVEREF(__pyx_tuple__30);
22928 
22929  /* "View.MemoryView":703
22930  * for suboffset in suboffsets[:ndim]:
22931  * if suboffset >= 0:
22932  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
22933  *
22934  *
22935  */
22936  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 703, __pyx_L1_error)
22937  __Pyx_GOTREF(__pyx_tuple__31);
22938  __Pyx_GIVEREF(__pyx_tuple__31);
22939 
22940  /* "(tree fragment)":2
22941  * def __reduce_cython__(self):
22942  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22943  * def __setstate_cython__(self, __pyx_state):
22944  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22945  */
22946  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 2, __pyx_L1_error)
22947  __Pyx_GOTREF(__pyx_tuple__32);
22948  __Pyx_GIVEREF(__pyx_tuple__32);
22949 
22950  /* "(tree fragment)":4
22951  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22952  * def __setstate_cython__(self, __pyx_state):
22953  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22954  */
22955  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 4, __pyx_L1_error)
22956  __Pyx_GOTREF(__pyx_tuple__33);
22957  __Pyx_GIVEREF(__pyx_tuple__33);
22958 
22959  /* "BoundaryConditions.py":52
22960  * # setattr(BC_Base, name, default_value)
22961  *
22962  * def getContext(self, context=None): # <<<<<<<<<<<<<<
22963  * """
22964  * Gets context from proteus.Context or
22965  */
22966  __pyx_tuple__35 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_Context); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 52, __pyx_L1_error)
22967  __Pyx_GOTREF(__pyx_tuple__35);
22968  __Pyx_GIVEREF(__pyx_tuple__35);
22969  __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_getContext, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 52, __pyx_L1_error)
22970 
22971  /* "(tree fragment)":1
22972  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
22973  * cdef tuple state
22974  * cdef object _dict
22975  */
22976  __pyx_tuple__36 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 1, __pyx_L1_error)
22977  __Pyx_GOTREF(__pyx_tuple__36);
22978  __Pyx_GIVEREF(__pyx_tuple__36);
22979  __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(1, 1, __pyx_L1_error)
22980 
22981  /* "(tree fragment)":16
22982  * else:
22983  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
22984  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
22985  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
22986  */
22987  __pyx_tuple__37 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 16, __pyx_L1_error)
22988  __Pyx_GOTREF(__pyx_tuple__37);
22989  __Pyx_GIVEREF(__pyx_tuple__37);
22990  __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(1, 16, __pyx_L1_error)
22991 
22992  /* "BoundaryConditions.py":81
22993  * self.uOfXT = None
22994  *
22995  * def init_cython(self): # <<<<<<<<<<<<<<
22996  * return self.uOfXT
22997  *
22998  */
22999  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 81, __pyx_L1_error)
23000  __Pyx_GOTREF(__pyx_tuple__38);
23001  __Pyx_GIVEREF(__pyx_tuple__38);
23002  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_init_cython, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 81, __pyx_L1_error)
23003 
23004  /* "BoundaryConditions.py":84
23005  * return self.uOfXT
23006  *
23007  * def resetBC(self): # <<<<<<<<<<<<<<
23008  * self.uOfXT = None
23009  *
23010  */
23011  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 84, __pyx_L1_error)
23012  __Pyx_GOTREF(__pyx_tuple__39);
23013  __Pyx_GIVEREF(__pyx_tuple__39);
23014  __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_resetBC, 84, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 84, __pyx_L1_error)
23015 
23016  /* "BoundaryConditions.py":87
23017  * self.uOfXT = None
23018  *
23019  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
23020  * """
23021  * function returning constant BC
23022  */
23023  __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 87, __pyx_L1_error)
23024  __Pyx_GOTREF(__pyx_tuple__40);
23025  __Pyx_GIVEREF(__pyx_tuple__40);
23026  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setConstantBC, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 87, __pyx_L1_error)
23027 
23028  /* "BoundaryConditions.py":100
23029  *
23030  *
23031  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
23032  * """
23033  * function returning value=a0+ax*x+ay*y+az*z
23034  */
23035  __pyx_tuple__41 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_a0, __pyx_n_s_a); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 100, __pyx_L1_error)
23036  __Pyx_GOTREF(__pyx_tuple__41);
23037  __Pyx_GIVEREF(__pyx_tuple__41);
23038  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setLinearBC, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 100, __pyx_L1_error)
23039 
23040  /* "BoundaryConditions.py":115
23041  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:])
23042  *
23043  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
23044  * """
23045  * function setting a linear ramp from t=0 to t=t1
23046  */
23047  __pyx_tuple__42 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_t1, __pyx_n_s_value); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 115, __pyx_L1_error)
23048  __Pyx_GOTREF(__pyx_tuple__42);
23049  __Pyx_GIVEREF(__pyx_tuple__42);
23050  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setLinearRamp, 115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 115, __pyx_L1_error)
23051 
23052  /* "(tree fragment)":1
23053  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
23054  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23055  * def __setstate_cython__(self, __pyx_state):
23056  */
23057  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 1, __pyx_L1_error)
23058  __Pyx_GOTREF(__pyx_tuple__43);
23059  __Pyx_GIVEREF(__pyx_tuple__43);
23060  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 1, __pyx_L1_error)
23061 
23062  /* "(tree fragment)":3
23063  * def __reduce_cython__(self):
23064  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23065  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
23066  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23067  */
23068  __pyx_tuple__44 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 3, __pyx_L1_error)
23069  __Pyx_GOTREF(__pyx_tuple__44);
23070  __Pyx_GIVEREF(__pyx_tuple__44);
23071  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 3, __pyx_L1_error)
23072 
23073  /* "(tree fragment)":1
23074  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23075  * cdef object __pyx_PickleError
23076  * cdef object __pyx_result
23077  */
23078  __pyx_tuple__45 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 1, __pyx_L1_error)
23079  __Pyx_GOTREF(__pyx_tuple__45);
23080  __Pyx_GIVEREF(__pyx_tuple__45);
23081  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_BC_Base, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 1, __pyx_L1_error)
23082 
23083  /* "View.MemoryView":286
23084  * return self.name
23085  *
23086  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23087  * cdef strided = Enum("<strided and direct>") # default
23088  * cdef indirect = Enum("<strided and indirect>")
23089  */
23090  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 286, __pyx_L1_error)
23091  __Pyx_GOTREF(__pyx_tuple__46);
23092  __Pyx_GIVEREF(__pyx_tuple__46);
23093 
23094  /* "View.MemoryView":287
23095  *
23096  * cdef generic = Enum("<strided and direct or indirect>")
23097  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23098  * cdef indirect = Enum("<strided and indirect>")
23099  *
23100  */
23101  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 287, __pyx_L1_error)
23102  __Pyx_GOTREF(__pyx_tuple__47);
23103  __Pyx_GIVEREF(__pyx_tuple__47);
23104 
23105  /* "View.MemoryView":288
23106  * cdef generic = Enum("<strided and direct or indirect>")
23107  * cdef strided = Enum("<strided and direct>") # default
23108  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23109  *
23110  *
23111  */
23112  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 288, __pyx_L1_error)
23113  __Pyx_GOTREF(__pyx_tuple__48);
23114  __Pyx_GIVEREF(__pyx_tuple__48);
23115 
23116  /* "View.MemoryView":291
23117  *
23118  *
23119  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23120  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23121  *
23122  */
23123  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 291, __pyx_L1_error)
23124  __Pyx_GOTREF(__pyx_tuple__49);
23125  __Pyx_GIVEREF(__pyx_tuple__49);
23126 
23127  /* "View.MemoryView":292
23128  *
23129  * cdef contiguous = Enum("<contiguous and direct>")
23130  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23131  *
23132  *
23133  */
23134  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 292, __pyx_L1_error)
23135  __Pyx_GOTREF(__pyx_tuple__50);
23136  __Pyx_GIVEREF(__pyx_tuple__50);
23137 
23138  /* "(tree fragment)":1
23139  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23140  * cdef object __pyx_PickleError
23141  * cdef object __pyx_result
23142  */
23143  __pyx_tuple__51 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 1, __pyx_L1_error)
23144  __Pyx_GOTREF(__pyx_tuple__51);
23145  __Pyx_GIVEREF(__pyx_tuple__51);
23146  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(1, 1, __pyx_L1_error)
23147  __Pyx_RefNannyFinishContext();
23148  return 0;
23149  __pyx_L1_error:;
23150  __Pyx_RefNannyFinishContext();
23151  return -1;
23152 }
23153 
23154 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
23155  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23156  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
23157  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23158  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
23159  __pyx_int_158231071 = PyInt_FromLong(158231071L); if (unlikely(!__pyx_int_158231071)) __PYX_ERR(0, 1, __pyx_L1_error)
23160  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
23161  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23162  return 0;
23163  __pyx_L1_error:;
23164  return -1;
23165 }
23166 
23167 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
23168 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
23169 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
23170 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
23171 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
23172 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
23173 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
23174 
23175 static int __Pyx_modinit_global_init_code(void) {
23176  __Pyx_RefNannyDeclarations
23177  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
23178  /*--- Global init code ---*/
23179  generic = Py_None; Py_INCREF(Py_None);
23180  strided = Py_None; Py_INCREF(Py_None);
23181  indirect = Py_None; Py_INCREF(Py_None);
23182  contiguous = Py_None; Py_INCREF(Py_None);
23183  indirect_contiguous = Py_None; Py_INCREF(Py_None);
23184  __Pyx_RefNannyFinishContext();
23185  return 0;
23186 }
23187 
23188 static int __Pyx_modinit_variable_export_code(void) {
23189  __Pyx_RefNannyDeclarations
23190  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
23191  /*--- Variable export code ---*/
23192  __Pyx_RefNannyFinishContext();
23193  return 0;
23194 }
23195 
23196 static int __Pyx_modinit_function_export_code(void) {
23197  __Pyx_RefNannyDeclarations
23198  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
23199  /*--- Function export code ---*/
23200  __Pyx_RefNannyFinishContext();
23201  return 0;
23202 }
23203 
23204 static int __Pyx_modinit_type_init_code(void) {
23205  __Pyx_RefNannyDeclarations
23206  int __pyx_lineno = 0;
23207  const char *__pyx_filename = NULL;
23208  int __pyx_clineno = 0;
23209  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
23210  /*--- Type init code ---*/
23211  if (PyType_Ready(&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
23212  #if PY_VERSION_HEX < 0x030800B1
23213  __pyx_type_18BoundaryConditions_BC_Base.tp_print = 0;
23214  #endif
23215  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions_BC_Base.tp_dictoffset && __pyx_type_18BoundaryConditions_BC_Base.tp_getattro == PyObject_GenericGetAttr)) {
23216  __pyx_type_18BoundaryConditions_BC_Base.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23217  }
23218  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BC_Base, (PyObject *)&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
23219  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
23220  __pyx_ptype_18BoundaryConditions_BC_Base = &__pyx_type_18BoundaryConditions_BC_Base;
23221  __pyx_vtabptr_18BoundaryConditions_BoundaryCondition = &__pyx_vtable_18BoundaryConditions_BoundaryCondition;
23222  __pyx_vtable_18BoundaryConditions_BoundaryCondition.resetBC = (void (*)(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *, int __pyx_skip_dispatch))__pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC;
23223  if (PyType_Ready(&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
23224  #if PY_VERSION_HEX < 0x030800B1
23225  __pyx_type_18BoundaryConditions_BoundaryCondition.tp_print = 0;
23226  #endif
23227  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions_BoundaryCondition.tp_dictoffset && __pyx_type_18BoundaryConditions_BoundaryCondition.tp_getattro == PyObject_GenericGetAttr)) {
23228  __pyx_type_18BoundaryConditions_BoundaryCondition.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23229  }
23230  if (__Pyx_SetVtable(__pyx_type_18BoundaryConditions_BoundaryCondition.tp_dict, __pyx_vtabptr_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
23231  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BoundaryCondition, (PyObject *)&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
23232  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
23233  __pyx_ptype_18BoundaryConditions_BoundaryCondition = &__pyx_type_18BoundaryConditions_BoundaryCondition;
23234  if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
23235  #if PY_VERSION_HEX < 0x030800B1
23236  __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_print = 0;
23237  #endif
23238  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_getattro == PyObject_GenericGetAttr)) {
23239  __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23240  }
23241  __pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC = &__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC;
23242  if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
23243  #if PY_VERSION_HEX < 0x030800B1
23244  __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_print = 0;
23245  #endif
23246  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_getattro == PyObject_GenericGetAttr)) {
23247  __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23248  }
23249  __pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = &__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC;
23250  if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
23251  #if PY_VERSION_HEX < 0x030800B1
23252  __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_print = 0;
23253  #endif
23254  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_getattro == PyObject_GenericGetAttr)) {
23255  __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23256  }
23257  __pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = &__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp;
23258  __pyx_vtabptr_array = &__pyx_vtable_array;
23259  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
23260  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23261  #if PY_VERSION_HEX < 0x030800B1
23262  __pyx_type___pyx_array.tp_print = 0;
23263  #endif
23264  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23265  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23266  __pyx_array_type = &__pyx_type___pyx_array;
23267  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
23268  #if PY_VERSION_HEX < 0x030800B1
23269  __pyx_type___pyx_MemviewEnum.tp_print = 0;
23270  #endif
23271  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
23272  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23273  }
23274  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
23275  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
23276  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
23277  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
23278  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
23279  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
23280  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
23281  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
23282  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
23283  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
23284  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23285  #if PY_VERSION_HEX < 0x030800B1
23286  __pyx_type___pyx_memoryview.tp_print = 0;
23287  #endif
23288  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
23289  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23290  }
23291  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23292  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23293  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
23294  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
23295  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
23296  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
23297  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
23298  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
23299  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23300  #if PY_VERSION_HEX < 0x030800B1
23301  __pyx_type___pyx_memoryviewslice.tp_print = 0;
23302  #endif
23303  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
23304  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23305  }
23306  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23307  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23308  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
23309  __Pyx_RefNannyFinishContext();
23310  return 0;
23311  __pyx_L1_error:;
23312  __Pyx_RefNannyFinishContext();
23313  return -1;
23314 }
23315 
23316 static int __Pyx_modinit_type_import_code(void) {
23317  __Pyx_RefNannyDeclarations
23318  PyObject *__pyx_t_1 = NULL;
23319  int __pyx_lineno = 0;
23320  const char *__pyx_filename = NULL;
23321  int __pyx_clineno = 0;
23322  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
23323  /*--- Type import code ---*/
23324  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
23325  __Pyx_GOTREF(__pyx_t_1);
23326  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
23327  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
23328  sizeof(PyTypeObject),
23329  #else
23330  sizeof(PyHeapTypeObject),
23331  #endif
23332  __Pyx_ImportType_CheckSize_Warn);
23333  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 9, __pyx_L1_error)
23334  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23335  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 200, __pyx_L1_error)
23336  __Pyx_GOTREF(__pyx_t_1);
23337  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
23338  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(3, 200, __pyx_L1_error)
23339  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
23340  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(3, 223, __pyx_L1_error)
23341  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
23342  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(3, 227, __pyx_L1_error)
23343  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
23344  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(3, 239, __pyx_L1_error)
23345  __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23346  if (!__pyx_ptype_5numpy_generic) __PYX_ERR(3, 771, __pyx_L1_error)
23347  __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23348  if (!__pyx_ptype_5numpy_number) __PYX_ERR(3, 773, __pyx_L1_error)
23349  __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23350  if (!__pyx_ptype_5numpy_integer) __PYX_ERR(3, 775, __pyx_L1_error)
23351  __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23352  if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(3, 777, __pyx_L1_error)
23353  __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23354  if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(3, 779, __pyx_L1_error)
23355  __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23356  if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(3, 781, __pyx_L1_error)
23357  __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23358  if (!__pyx_ptype_5numpy_floating) __PYX_ERR(3, 783, __pyx_L1_error)
23359  __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23360  if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(3, 785, __pyx_L1_error)
23361  __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23362  if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(3, 787, __pyx_L1_error)
23363  __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23364  if (!__pyx_ptype_5numpy_character) __PYX_ERR(3, 789, __pyx_L1_error)
23365  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
23366  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(3, 827, __pyx_L1_error)
23367  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23368  __Pyx_RefNannyFinishContext();
23369  return 0;
23370  __pyx_L1_error:;
23371  __Pyx_XDECREF(__pyx_t_1);
23372  __Pyx_RefNannyFinishContext();
23373  return -1;
23374 }
23375 
23376 static int __Pyx_modinit_variable_import_code(void) {
23377  __Pyx_RefNannyDeclarations
23378  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
23379  /*--- Variable import code ---*/
23380  __Pyx_RefNannyFinishContext();
23381  return 0;
23382 }
23383 
23384 static int __Pyx_modinit_function_import_code(void) {
23385  __Pyx_RefNannyDeclarations
23386  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
23387  /*--- Function import code ---*/
23388  __Pyx_RefNannyFinishContext();
23389  return 0;
23390 }
23391 
23392 
23393 #ifndef CYTHON_NO_PYINIT_EXPORT
23394 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23395 #elif PY_MAJOR_VERSION < 3
23396 #ifdef __cplusplus
23397 #define __Pyx_PyMODINIT_FUNC extern "C" void
23398 #else
23399 #define __Pyx_PyMODINIT_FUNC void
23400 #endif
23401 #else
23402 #ifdef __cplusplus
23403 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
23404 #else
23405 #define __Pyx_PyMODINIT_FUNC PyObject *
23406 #endif
23407 #endif
23408 
23409 
23410 #if PY_MAJOR_VERSION < 3
23411 __Pyx_PyMODINIT_FUNC initBoundaryConditions(void) CYTHON_SMALL_CODE; /*proto*/
23412 __Pyx_PyMODINIT_FUNC initBoundaryConditions(void)
23413 #else
23414 __Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void) CYTHON_SMALL_CODE; /*proto*/
23415 __Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)
23416 #if CYTHON_PEP489_MULTI_PHASE_INIT
23417 {
23418  return PyModuleDef_Init(&__pyx_moduledef);
23419 }
23420 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
23421  #if PY_VERSION_HEX >= 0x030700A1
23422  static PY_INT64_T main_interpreter_id = -1;
23423  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
23424  if (main_interpreter_id == -1) {
23425  main_interpreter_id = current_id;
23426  return (unlikely(current_id == -1)) ? -1 : 0;
23427  } else if (unlikely(main_interpreter_id != current_id))
23428  #else
23429  static PyInterpreterState *main_interpreter = NULL;
23430  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
23431  if (!main_interpreter) {
23432  main_interpreter = current_interpreter;
23433  } else if (unlikely(main_interpreter != current_interpreter))
23434  #endif
23435  {
23436  PyErr_SetString(
23437  PyExc_ImportError,
23438  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
23439  return -1;
23440  }
23441  return 0;
23442 }
23443 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
23444  PyObject *value = PyObject_GetAttrString(spec, from_name);
23445  int result = 0;
23446  if (likely(value)) {
23447  if (allow_none || value != Py_None) {
23448  result = PyDict_SetItemString(moddict, to_name, value);
23449  }
23450  Py_DECREF(value);
23451  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
23452  PyErr_Clear();
23453  } else {
23454  result = -1;
23455  }
23456  return result;
23457 }
23458 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
23459  PyObject *module = NULL, *moddict, *modname;
23460  if (__Pyx_check_single_interpreter())
23461  return NULL;
23462  if (__pyx_m)
23463  return __Pyx_NewRef(__pyx_m);
23464  modname = PyObject_GetAttrString(spec, "name");
23465  if (unlikely(!modname)) goto bad;
23466  module = PyModule_NewObject(modname);
23467  Py_DECREF(modname);
23468  if (unlikely(!module)) goto bad;
23469  moddict = PyModule_GetDict(module);
23470  if (unlikely(!moddict)) goto bad;
23471  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
23472  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
23473  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
23474  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
23475  return module;
23476 bad:
23477  Py_XDECREF(module);
23478  return NULL;
23479 }
23480 
23481 
23482 static CYTHON_SMALL_CODE int __pyx_pymod_exec_BoundaryConditions(PyObject *__pyx_pyinit_module)
23483 #endif
23484 #endif
23485 {
23486  __Pyx_TraceDeclarations
23487  PyObject *__pyx_t_1 = NULL;
23488  static PyThread_type_lock __pyx_t_2[8];
23489  int __pyx_lineno = 0;
23490  const char *__pyx_filename = NULL;
23491  int __pyx_clineno = 0;
23492  __Pyx_RefNannyDeclarations
23493  #if CYTHON_PEP489_MULTI_PHASE_INIT
23494  if (__pyx_m) {
23495  if (__pyx_m == __pyx_pyinit_module) return 0;
23496  PyErr_SetString(PyExc_RuntimeError, "Module 'BoundaryConditions' has already been imported. Re-initialisation is not supported.");
23497  return -1;
23498  }
23499  #elif PY_MAJOR_VERSION >= 3
23500  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
23501  #endif
23502  #if CYTHON_REFNANNY
23503 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
23504 if (!__Pyx_RefNanny) {
23505  PyErr_Clear();
23506  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
23507  if (!__Pyx_RefNanny)
23508  Py_FatalError("failed to import 'refnanny' module");
23509 }
23510 #endif
23511  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)", 0);
23512  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23513  #ifdef __Pxy_PyFrame_Initialize_Offsets
23514  __Pxy_PyFrame_Initialize_Offsets();
23515  #endif
23516  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
23517  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
23518  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
23519  #ifdef __Pyx_CyFunction_USED
23520  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23521  #endif
23522  #ifdef __Pyx_FusedFunction_USED
23523  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23524  #endif
23525  #ifdef __Pyx_Coroutine_USED
23526  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23527  #endif
23528  #ifdef __Pyx_Generator_USED
23529  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23530  #endif
23531  #ifdef __Pyx_AsyncGen_USED
23532  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23533  #endif
23534  #ifdef __Pyx_StopAsyncIteration_USED
23535  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23536  #endif
23537  /*--- Library function declarations ---*/
23538  /*--- Threads initialization code ---*/
23539  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23540  PyEval_InitThreads();
23541  #endif
23542  /*--- Module creation code ---*/
23543  #if CYTHON_PEP489_MULTI_PHASE_INIT
23544  __pyx_m = __pyx_pyinit_module;
23545  Py_INCREF(__pyx_m);
23546  #else
23547  #if PY_MAJOR_VERSION < 3
23548  __pyx_m = Py_InitModule4("BoundaryConditions", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23549  #else
23550  __pyx_m = PyModule_Create(&__pyx_moduledef);
23551  #endif
23552  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23553  #endif
23554  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23555  Py_INCREF(__pyx_d);
23556  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23557  Py_INCREF(__pyx_b);
23558  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23559  Py_INCREF(__pyx_cython_runtime);
23560  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23561  /*--- Initialize various global constants etc. ---*/
23562  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23563  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23564  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23565  #endif
23566  if (__pyx_module_is_main_BoundaryConditions) {
23567  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23568  }
23569  #if PY_MAJOR_VERSION >= 3
23570  {
23571  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23572  if (!PyDict_GetItemString(modules, "BoundaryConditions")) {
23573  if (unlikely(PyDict_SetItemString(modules, "BoundaryConditions", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23574  }
23575  }
23576  #endif
23577  /*--- Builtin init code ---*/
23578  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23579  /*--- Constants init code ---*/
23580  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23581  /*--- Global type/function init code ---*/
23582  (void)__Pyx_modinit_global_init_code();
23583  (void)__Pyx_modinit_variable_export_code();
23584  (void)__Pyx_modinit_function_export_code();
23585  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23586  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23587  (void)__Pyx_modinit_variable_import_code();
23588  (void)__Pyx_modinit_function_import_code();
23589  /*--- Execution code ---*/
23590  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23591  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23592  #endif
23593  __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
23594 
23595  /* "BoundaryConditions.py":9
23596  *
23597  * import cython
23598  * import numpy as np # <<<<<<<<<<<<<<
23599  * """
23600  * Module for creating boundary conditions. Imported in SpatialTools.py
23601  */
23602  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
23603  __Pyx_GOTREF(__pyx_t_1);
23604  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
23605  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23606 
23607  /* "BoundaryConditions.py":17
23608  * """
23609  *
23610  * __all__ = ['BC_Base', # <<<<<<<<<<<<<<
23611  * 'BoundaryCondition']
23612  *
23613  */
23614  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
23615  __Pyx_GOTREF(__pyx_t_1);
23616  __Pyx_INCREF(__pyx_n_s_BC_Base);
23617  __Pyx_GIVEREF(__pyx_n_s_BC_Base);
23618  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_BC_Base);
23619  __Pyx_INCREF(__pyx_n_s_BoundaryCondition);
23620  __Pyx_GIVEREF(__pyx_n_s_BoundaryCondition);
23621  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_BoundaryCondition);
23622  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
23623  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23624 
23625  /* "BoundaryConditions.py":52
23626  * # setattr(BC_Base, name, default_value)
23627  *
23628  * def getContext(self, context=None): # <<<<<<<<<<<<<<
23629  * """
23630  * Gets context from proteus.Context or
23631  */
23632  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_7BC_Base_3getContext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base_getContext, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj_)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
23633  __Pyx_GOTREF(__pyx_t_1);
23634  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base->tp_dict, __pyx_n_s_getContext, __pyx_t_1) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
23635  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23636  PyType_Modified(__pyx_ptype_18BoundaryConditions_BC_Base);
23637 
23638  /* "(tree fragment)":1
23639  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
23640  * cdef tuple state
23641  * cdef object _dict
23642  */
23643  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_7BC_Base_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base___reduce_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23644  __Pyx_GOTREF(__pyx_t_1);
23645  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base->tp_dict, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23646  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23647  PyType_Modified(__pyx_ptype_18BoundaryConditions_BC_Base);
23648 
23649  /* "(tree fragment)":16
23650  * else:
23651  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
23652  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
23653  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
23654  */
23655  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_7BC_Base_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base___setstate_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
23656  __Pyx_GOTREF(__pyx_t_1);
23657  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base->tp_dict, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 16, __pyx_L1_error)
23658  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23659  PyType_Modified(__pyx_ptype_18BoundaryConditions_BC_Base);
23660 
23661  /* "BoundaryConditions.py":81
23662  * self.uOfXT = None
23663  *
23664  * def init_cython(self): # <<<<<<<<<<<<<<
23665  * return self.uOfXT
23666  *
23667  */
23668  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_3init_cython, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_init_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
23669  __Pyx_GOTREF(__pyx_t_1);
23670  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_init_cython, __pyx_t_1) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
23671  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23672  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23673 
23674  /* "BoundaryConditions.py":84
23675  * return self.uOfXT
23676  *
23677  * def resetBC(self): # <<<<<<<<<<<<<<
23678  * self.uOfXT = None
23679  *
23680  */
23681  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_5resetBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_resetBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
23682  __Pyx_GOTREF(__pyx_t_1);
23683  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_resetBC, __pyx_t_1) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
23684  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23685  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23686 
23687  /* "BoundaryConditions.py":87
23688  * self.uOfXT = None
23689  *
23690  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
23691  * """
23692  * function returning constant BC
23693  */
23694  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_7setConstantBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setConstantBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
23695  __Pyx_GOTREF(__pyx_t_1);
23696  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setConstantBC, __pyx_t_1) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
23697  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23698  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23699 
23700  /* "BoundaryConditions.py":100
23701  *
23702  *
23703  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
23704  * """
23705  * function returning value=a0+ax*x+ay*y+az*z
23706  */
23707  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_9setLinearBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setLinearBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
23708  __Pyx_GOTREF(__pyx_t_1);
23709  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setLinearBC, __pyx_t_1) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
23710  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23711  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23712 
23713  /* "BoundaryConditions.py":115
23714  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:])
23715  *
23716  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
23717  * """
23718  * function setting a linear ramp from t=0 to t=t1
23719  */
23720  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setLinearRamp, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
23721  __Pyx_GOTREF(__pyx_t_1);
23722  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setLinearRamp, __pyx_t_1) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
23723  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23724  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23725 
23726  /* "(tree fragment)":1
23727  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
23728  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23729  * def __setstate_cython__(self, __pyx_state):
23730  */
23731  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition___reduce_cytho, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23732  __Pyx_GOTREF(__pyx_t_1);
23733  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23734  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23735 
23736  /* "(tree fragment)":3
23737  * def __reduce_cython__(self):
23738  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23739  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
23740  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23741  */
23742  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition___setstate_cyt, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
23743  __Pyx_GOTREF(__pyx_t_1);
23744  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
23745  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23746 
23747  /* "(tree fragment)":1
23748  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23749  * cdef object __pyx_PickleError
23750  * cdef object __pyx_result
23751  */
23752  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_1__pyx_unpickle_BC_Base, 0, __pyx_n_s_pyx_unpickle_BC_Base, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23753  __Pyx_GOTREF(__pyx_t_1);
23754  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_BC_Base, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23755  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23756 
23757  /* "BoundaryConditions.py":1
23758  * #!python # <<<<<<<<<<<<<<
23759  * # distutils: language = c++
23760  * # cython: profile=True, binding=True, embedsignature=True
23761  */
23762  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23763  __Pyx_GOTREF(__pyx_t_1);
23764  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23765  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23766 
23767  /* "View.MemoryView":209
23768  * info.obj = self
23769  *
23770  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23771  *
23772  * def __dealloc__(array self):
23773  */
23774  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
23775  __Pyx_GOTREF(__pyx_t_1);
23776  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
23777  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23778  PyType_Modified(__pyx_array_type);
23779 
23780  /* "View.MemoryView":286
23781  * return self.name
23782  *
23783  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23784  * cdef strided = Enum("<strided and direct>") # default
23785  * cdef indirect = Enum("<strided and indirect>")
23786  */
23787  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
23788  __Pyx_GOTREF(__pyx_t_1);
23789  __Pyx_XGOTREF(generic);
23790  __Pyx_DECREF_SET(generic, __pyx_t_1);
23791  __Pyx_GIVEREF(__pyx_t_1);
23792  __pyx_t_1 = 0;
23793 
23794  /* "View.MemoryView":287
23795  *
23796  * cdef generic = Enum("<strided and direct or indirect>")
23797  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23798  * cdef indirect = Enum("<strided and indirect>")
23799  *
23800  */
23801  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
23802  __Pyx_GOTREF(__pyx_t_1);
23803  __Pyx_XGOTREF(strided);
23804  __Pyx_DECREF_SET(strided, __pyx_t_1);
23805  __Pyx_GIVEREF(__pyx_t_1);
23806  __pyx_t_1 = 0;
23807 
23808  /* "View.MemoryView":288
23809  * cdef generic = Enum("<strided and direct or indirect>")
23810  * cdef strided = Enum("<strided and direct>") # default
23811  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23812  *
23813  *
23814  */
23815  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
23816  __Pyx_GOTREF(__pyx_t_1);
23817  __Pyx_XGOTREF(indirect);
23818  __Pyx_DECREF_SET(indirect, __pyx_t_1);
23819  __Pyx_GIVEREF(__pyx_t_1);
23820  __pyx_t_1 = 0;
23821 
23822  /* "View.MemoryView":291
23823  *
23824  *
23825  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23826  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23827  *
23828  */
23829  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
23830  __Pyx_GOTREF(__pyx_t_1);
23831  __Pyx_XGOTREF(contiguous);
23832  __Pyx_DECREF_SET(contiguous, __pyx_t_1);
23833  __Pyx_GIVEREF(__pyx_t_1);
23834  __pyx_t_1 = 0;
23835 
23836  /* "View.MemoryView":292
23837  *
23838  * cdef contiguous = Enum("<contiguous and direct>")
23839  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23840  *
23841  *
23842  */
23843  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
23844  __Pyx_GOTREF(__pyx_t_1);
23845  __Pyx_XGOTREF(indirect_contiguous);
23846  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
23847  __Pyx_GIVEREF(__pyx_t_1);
23848  __pyx_t_1 = 0;
23849 
23850  /* "View.MemoryView":316
23851  *
23852  * DEF THREAD_LOCKS_PREALLOCATED = 8
23853  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
23854  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
23855  * PyThread_allocate_lock(),
23856  */
23857  __pyx_memoryview_thread_locks_used = 0;
23858 
23859  /* "View.MemoryView":317
23860  * DEF THREAD_LOCKS_PREALLOCATED = 8
23861  * cdef int __pyx_memoryview_thread_locks_used = 0
23862  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
23863  * PyThread_allocate_lock(),
23864  * PyThread_allocate_lock(),
23865  */
23866  __pyx_t_2[0] = PyThread_allocate_lock();
23867  __pyx_t_2[1] = PyThread_allocate_lock();
23868  __pyx_t_2[2] = PyThread_allocate_lock();
23869  __pyx_t_2[3] = PyThread_allocate_lock();
23870  __pyx_t_2[4] = PyThread_allocate_lock();
23871  __pyx_t_2[5] = PyThread_allocate_lock();
23872  __pyx_t_2[6] = PyThread_allocate_lock();
23873  __pyx_t_2[7] = PyThread_allocate_lock();
23874  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
23875 
23876  /* "View.MemoryView":549
23877  * info.obj = self
23878  *
23879  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23880  *
23881  *
23882  */
23883  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
23884  __Pyx_GOTREF(__pyx_t_1);
23885  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
23886  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23887  PyType_Modified(__pyx_memoryview_type);
23888 
23889  /* "View.MemoryView":995
23890  * return self.from_object
23891  *
23892  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23893  *
23894  *
23895  */
23896  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 995, __pyx_L1_error)
23897  __Pyx_GOTREF(__pyx_t_1);
23898  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
23899  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23900  PyType_Modified(__pyx_memoryviewslice_type);
23901 
23902  /* "(tree fragment)":1
23903  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23904  * cdef object __pyx_PickleError
23905  * cdef object __pyx_result
23906  */
23907  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23908  __Pyx_GOTREF(__pyx_t_1);
23909  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23910  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23911 
23912  /* "(tree fragment)":11
23913  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
23914  * return __pyx_result
23915  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
23916  * __pyx_result.name = __pyx_state[0]
23917  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
23918  */
23919  __Pyx_TraceReturn(Py_None, 0);
23920 
23921  /*--- Wrapped vars code ---*/
23922 
23923  goto __pyx_L0;
23924  __pyx_L1_error:;
23925  __Pyx_XDECREF(__pyx_t_1);
23926  if (__pyx_m) {
23927  if (__pyx_d) {
23928  __Pyx_AddTraceback("init BoundaryConditions", __pyx_clineno, __pyx_lineno, __pyx_filename);
23929  }
23930  Py_CLEAR(__pyx_m);
23931  } else if (!PyErr_Occurred()) {
23932  PyErr_SetString(PyExc_ImportError, "init BoundaryConditions");
23933  }
23934  __pyx_L0:;
23935  __Pyx_RefNannyFinishContext();
23936  #if CYTHON_PEP489_MULTI_PHASE_INIT
23937  return (__pyx_m != NULL) ? 0 : -1;
23938  #elif PY_MAJOR_VERSION >= 3
23939  return __pyx_m;
23940  #else
23941  return;
23942  #endif
23943 }
23944 
23945 /* --- Runtime support code --- */
23946 /* Refnanny */
23947 #if CYTHON_REFNANNY
23948 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
23949  PyObject *m = NULL, *p = NULL;
23950  void *r = NULL;
23951  m = PyImport_ImportModule(modname);
23952  if (!m) goto end;
23953  p = PyObject_GetAttrString(m, "RefNannyAPI");
23954  if (!p) goto end;
23955  r = PyLong_AsVoidPtr(p);
23956 end:
23957  Py_XDECREF(p);
23958  Py_XDECREF(m);
23959  return (__Pyx_RefNannyAPIStruct *)r;
23960 }
23961 #endif
23962 
23963 /* PyObjectGetAttrStr */
23964 #if CYTHON_USE_TYPE_SLOTS
23965 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23966  PyTypeObject* tp = Py_TYPE(obj);
23967  if (likely(tp->tp_getattro))
23968  return tp->tp_getattro(obj, attr_name);
23969 #if PY_MAJOR_VERSION < 3
23970  if (likely(tp->tp_getattr))
23971  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23972 #endif
23973  return PyObject_GetAttr(obj, attr_name);
23974 }
23975 #endif
23976 
23977 /* GetBuiltinName */
23978 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23979  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23980  if (unlikely(!result)) {
23981  PyErr_Format(PyExc_NameError,
23982 #if PY_MAJOR_VERSION >= 3
23983  "name '%U' is not defined", name);
23984 #else
23985  "name '%.200s' is not defined", PyString_AS_STRING(name));
23986 #endif
23987  }
23988  return result;
23989 }
23990 
23991 /* RaiseDoubleKeywords */
23992 static void __Pyx_RaiseDoubleKeywordsError(
23993  const char* func_name,
23994  PyObject* kw_name)
23995 {
23996  PyErr_Format(PyExc_TypeError,
23997  #if PY_MAJOR_VERSION >= 3
23998  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23999  #else
24000  "%s() got multiple values for keyword argument '%s'", func_name,
24001  PyString_AsString(kw_name));
24002  #endif
24003 }
24004 
24005 /* ParseKeywords */
24006 static int __Pyx_ParseOptionalKeywords(
24007  PyObject *kwds,
24008  PyObject **argnames[],
24009  PyObject *kwds2,
24010  PyObject *values[],
24011  Py_ssize_t num_pos_args,
24012  const char* function_name)
24013 {
24014  PyObject *key = 0, *value = 0;
24015  Py_ssize_t pos = 0;
24016  PyObject*** name;
24017  PyObject*** first_kw_arg = argnames + num_pos_args;
24018  while (PyDict_Next(kwds, &pos, &key, &value)) {
24019  name = first_kw_arg;
24020  while (*name && (**name != key)) name++;
24021  if (*name) {
24022  values[name-argnames] = value;
24023  continue;
24024  }
24025  name = first_kw_arg;
24026  #if PY_MAJOR_VERSION < 3
24027  if (likely(PyString_Check(key))) {
24028  while (*name) {
24029  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
24030  && _PyString_Eq(**name, key)) {
24031  values[name-argnames] = value;
24032  break;
24033  }
24034  name++;
24035  }
24036  if (*name) continue;
24037  else {
24038  PyObject*** argname = argnames;
24039  while (argname != first_kw_arg) {
24040  if ((**argname == key) || (
24041  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
24042  && _PyString_Eq(**argname, key))) {
24043  goto arg_passed_twice;
24044  }
24045  argname++;
24046  }
24047  }
24048  } else
24049  #endif
24050  if (likely(PyUnicode_Check(key))) {
24051  while (*name) {
24052  int cmp = (**name == key) ? 0 :
24053  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24054  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24055  #endif
24056  PyUnicode_Compare(**name, key);
24057  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
24058  if (cmp == 0) {
24059  values[name-argnames] = value;
24060  break;
24061  }
24062  name++;
24063  }
24064  if (*name) continue;
24065  else {
24066  PyObject*** argname = argnames;
24067  while (argname != first_kw_arg) {
24068  int cmp = (**argname == key) ? 0 :
24069  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24070  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24071  #endif
24072  PyUnicode_Compare(**argname, key);
24073  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
24074  if (cmp == 0) goto arg_passed_twice;
24075  argname++;
24076  }
24077  }
24078  } else
24079  goto invalid_keyword_type;
24080  if (kwds2) {
24081  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
24082  } else {
24083  goto invalid_keyword;
24084  }
24085  }
24086  return 0;
24087 arg_passed_twice:
24088  __Pyx_RaiseDoubleKeywordsError(function_name, key);
24089  goto bad;
24090 invalid_keyword_type:
24091  PyErr_Format(PyExc_TypeError,
24092  "%.200s() keywords must be strings", function_name);
24093  goto bad;
24094 invalid_keyword:
24095  PyErr_Format(PyExc_TypeError,
24096  #if PY_MAJOR_VERSION < 3
24097  "%.200s() got an unexpected keyword argument '%.200s'",
24098  function_name, PyString_AsString(key));
24099  #else
24100  "%s() got an unexpected keyword argument '%U'",
24101  function_name, key);
24102  #endif
24103 bad:
24104  return -1;
24105 }
24106 
24107 /* RaiseArgTupleInvalid */
24108 static void __Pyx_RaiseArgtupleInvalid(
24109  const char* func_name,
24110  int exact,
24111  Py_ssize_t num_min,
24112  Py_ssize_t num_max,
24113  Py_ssize_t num_found)
24114 {
24115  Py_ssize_t num_expected;
24116  const char *more_or_less;
24117  if (num_found < num_min) {
24118  num_expected = num_min;
24119  more_or_less = "at least";
24120  } else {
24121  num_expected = num_max;
24122  more_or_less = "at most";
24123  }
24124  if (exact) {
24125  more_or_less = "exactly";
24126  }
24127  PyErr_Format(PyExc_TypeError,
24128  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
24129  func_name, more_or_less, num_expected,
24130  (num_expected == 1) ? "" : "s", num_found);
24131 }
24132 
24133 /* PyErrFetchRestore */
24134 #if CYTHON_FAST_THREAD_STATE
24135 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24136  PyObject *tmp_type, *tmp_value, *tmp_tb;
24137  tmp_type = tstate->curexc_type;
24138  tmp_value = tstate->curexc_value;
24139  tmp_tb = tstate->curexc_traceback;
24140  tstate->curexc_type = type;
24141  tstate->curexc_value = value;
24142  tstate->curexc_traceback = tb;
24143  Py_XDECREF(tmp_type);
24144  Py_XDECREF(tmp_value);
24145  Py_XDECREF(tmp_tb);
24146 }
24147 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24148  *type = tstate->curexc_type;
24149  *value = tstate->curexc_value;
24150  *tb = tstate->curexc_traceback;
24151  tstate->curexc_type = 0;
24152  tstate->curexc_value = 0;
24153  tstate->curexc_traceback = 0;
24154 }
24155 #endif
24156 
24157 /* Profile */
24158 #if CYTHON_PROFILE
24159 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
24160  PyFrameObject** frame,
24161  PyThreadState* tstate,
24162  const char *funcname,
24163  const char *srcfile,
24164  int firstlineno) {
24165  PyObject *type, *value, *traceback;
24166  int retval;
24167  if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
24168  if (*code == NULL) {
24169  *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
24170  if (*code == NULL) return 0;
24171  }
24172  *frame = PyFrame_New(
24173  tstate, /*PyThreadState *tstate*/
24174  *code, /*PyCodeObject *code*/
24175  __pyx_d, /*PyObject *globals*/
24176  0 /*PyObject *locals*/
24177  );
24178  if (*frame == NULL) return 0;
24179  if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
24180  Py_INCREF(Py_None);
24181  (*frame)->f_trace = Py_None;
24182  }
24183 #if PY_VERSION_HEX < 0x030400B1
24184  } else {
24185  (*frame)->f_tstate = tstate;
24186 #endif
24187  }
24188  __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
24189  retval = 1;
24190  tstate->tracing++;
24191  __Pyx_SetTracing(tstate, 0);
24192  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
24193  #if CYTHON_TRACE
24194  if (tstate->c_tracefunc)
24195  retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
24196  if (retval && tstate->c_profilefunc)
24197  #endif
24198  retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
24199  __Pyx_SetTracing(tstate, (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc)));
24200  tstate->tracing--;
24201  if (retval) {
24202  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
24203  return __Pyx_IsTracing(tstate, 0, 0) && retval;
24204  } else {
24205  Py_XDECREF(type);
24206  Py_XDECREF(value);
24207  Py_XDECREF(traceback);
24208  return -1;
24209  }
24210 }
24211 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
24212  PyCodeObject *py_code = 0;
24213 #if PY_MAJOR_VERSION >= 3
24214  py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
24215  if (likely(py_code)) {
24216  py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
24217  }
24218 #else
24219  PyObject *py_srcfile = 0;
24220  PyObject *py_funcname = 0;
24221  py_funcname = PyString_FromString(funcname);
24222  if (unlikely(!py_funcname)) goto bad;
24223  py_srcfile = PyString_FromString(srcfile);
24224  if (unlikely(!py_srcfile)) goto bad;
24225  py_code = PyCode_New(
24226  0,
24227  0,
24228  0,
24229  CO_OPTIMIZED | CO_NEWLOCALS,
24230  __pyx_empty_bytes, /*PyObject *code,*/
24231  __pyx_empty_tuple, /*PyObject *consts,*/
24232  __pyx_empty_tuple, /*PyObject *names,*/
24233  __pyx_empty_tuple, /*PyObject *varnames,*/
24234  __pyx_empty_tuple, /*PyObject *freevars,*/
24235  __pyx_empty_tuple, /*PyObject *cellvars,*/
24236  py_srcfile, /*PyObject *filename,*/
24237  py_funcname, /*PyObject *name,*/
24238  firstlineno,
24239  __pyx_empty_bytes /*PyObject *lnotab*/
24240  );
24241 bad:
24242  Py_XDECREF(py_srcfile);
24243  Py_XDECREF(py_funcname);
24244 #endif
24245  return py_code;
24246 }
24247 #endif
24248 
24249 /* GetItemInt */
24250 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24251  PyObject *r;
24252  if (!j) return NULL;
24253  r = PyObject_GetItem(o, j);
24254  Py_DECREF(j);
24255  return r;
24256 }
24257 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24258  CYTHON_NCP_UNUSED int wraparound,
24259  CYTHON_NCP_UNUSED int boundscheck) {
24260 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24261  Py_ssize_t wrapped_i = i;
24262  if (wraparound & unlikely(i < 0)) {
24263  wrapped_i += PyList_GET_SIZE(o);
24264  }
24265  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
24266  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
24267  Py_INCREF(r);
24268  return r;
24269  }
24270  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24271 #else
24272  return PySequence_GetItem(o, i);
24273 #endif
24274 }
24275 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24276  CYTHON_NCP_UNUSED int wraparound,
24277  CYTHON_NCP_UNUSED int boundscheck) {
24278 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24279  Py_ssize_t wrapped_i = i;
24280  if (wraparound & unlikely(i < 0)) {
24281  wrapped_i += PyTuple_GET_SIZE(o);
24282  }
24283  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
24284  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
24285  Py_INCREF(r);
24286  return r;
24287  }
24288  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24289 #else
24290  return PySequence_GetItem(o, i);
24291 #endif
24292 }
24293 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
24294  CYTHON_NCP_UNUSED int wraparound,
24295  CYTHON_NCP_UNUSED int boundscheck) {
24296 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24297  if (is_list || PyList_CheckExact(o)) {
24298  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24299  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
24300  PyObject *r = PyList_GET_ITEM(o, n);
24301  Py_INCREF(r);
24302  return r;
24303  }
24304  }
24305  else if (PyTuple_CheckExact(o)) {
24306  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24307  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
24308  PyObject *r = PyTuple_GET_ITEM(o, n);
24309  Py_INCREF(r);
24310  return r;
24311  }
24312  } else {
24313  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24314  if (likely(m && m->sq_item)) {
24315  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24316  Py_ssize_t l = m->sq_length(o);
24317  if (likely(l >= 0)) {
24318  i += l;
24319  } else {
24320  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24321  return NULL;
24322  PyErr_Clear();
24323  }
24324  }
24325  return m->sq_item(o, i);
24326  }
24327  }
24328 #else
24329  if (is_list || PySequence_Check(o)) {
24330  return PySequence_GetItem(o, i);
24331  }
24332 #endif
24333  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24334 }
24335 
24336 /* ObjectGetItem */
24337 #if CYTHON_USE_TYPE_SLOTS
24338 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
24339  PyObject *runerr;
24340  Py_ssize_t key_value;
24341  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
24342  if (unlikely(!(m && m->sq_item))) {
24343  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
24344  return NULL;
24345  }
24346  key_value = __Pyx_PyIndex_AsSsize_t(index);
24347  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
24348  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
24349  }
24350  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
24351  PyErr_Clear();
24352  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
24353  }
24354  return NULL;
24355 }
24356 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
24357  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
24358  if (likely(m && m->mp_subscript)) {
24359  return m->mp_subscript(obj, key);
24360  }
24361  return __Pyx_PyObject_GetIndex(obj, key);
24362 }
24363 #endif
24364 
24365 /* MemviewSliceInit */
24366 static int
24367 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
24368  int ndim,
24369  __Pyx_memviewslice *memviewslice,
24370  int memview_is_new_reference)
24371 {
24372  __Pyx_RefNannyDeclarations
24373  int i, retval=-1;
24374  Py_buffer *buf = &memview->view;
24375  __Pyx_RefNannySetupContext("init_memviewslice", 0);
24376  if (unlikely(memviewslice->memview || memviewslice->data)) {
24377  PyErr_SetString(PyExc_ValueError,
24378  "memviewslice is already initialized!");
24379  goto fail;
24380  }
24381  if (buf->strides) {
24382  for (i = 0; i < ndim; i++) {
24383  memviewslice->strides[i] = buf->strides[i];
24384  }
24385  } else {
24386  Py_ssize_t stride = buf->itemsize;
24387  for (i = ndim - 1; i >= 0; i--) {
24388  memviewslice->strides[i] = stride;
24389  stride *= buf->shape[i];
24390  }
24391  }
24392  for (i = 0; i < ndim; i++) {
24393  memviewslice->shape[i] = buf->shape[i];
24394  if (buf->suboffsets) {
24395  memviewslice->suboffsets[i] = buf->suboffsets[i];
24396  } else {
24397  memviewslice->suboffsets[i] = -1;
24398  }
24399  }
24400  memviewslice->memview = memview;
24401  memviewslice->data = (char *)buf->buf;
24402  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
24403  Py_INCREF(memview);
24404  }
24405  retval = 0;
24406  goto no_fail;
24407 fail:
24408  memviewslice->memview = 0;
24409  memviewslice->data = 0;
24410  retval = -1;
24411 no_fail:
24412  __Pyx_RefNannyFinishContext();
24413  return retval;
24414 }
24415 #ifndef Py_NO_RETURN
24416 #define Py_NO_RETURN
24417 #endif
24418 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
24419  va_list vargs;
24420  char msg[200];
24421 #ifdef HAVE_STDARG_PROTOTYPES
24422  va_start(vargs, fmt);
24423 #else
24424  va_start(vargs);
24425 #endif
24426  vsnprintf(msg, 200, fmt, vargs);
24427  va_end(vargs);
24428  Py_FatalError(msg);
24429 }
24430 static CYTHON_INLINE int
24431 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24432  PyThread_type_lock lock)
24433 {
24434  int result;
24435  PyThread_acquire_lock(lock, 1);
24436  result = (*acquisition_count)++;
24437  PyThread_release_lock(lock);
24438  return result;
24439 }
24440 static CYTHON_INLINE int
24441 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24442  PyThread_type_lock lock)
24443 {
24444  int result;
24445  PyThread_acquire_lock(lock, 1);
24446  result = (*acquisition_count)--;
24447  PyThread_release_lock(lock);
24448  return result;
24449 }
24450 static CYTHON_INLINE void
24451 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
24452 {
24453  int first_time;
24454  struct __pyx_memoryview_obj *memview = memslice->memview;
24455  if (unlikely(!memview || (PyObject *) memview == Py_None))
24456  return;
24457  if (unlikely(__pyx_get_slice_count(memview) < 0))
24458  __pyx_fatalerror("Acquisition count is %d (line %d)",
24459  __pyx_get_slice_count(memview), lineno);
24460  first_time = __pyx_add_acquisition_count(memview) == 0;
24461  if (unlikely(first_time)) {
24462  if (have_gil) {
24463  Py_INCREF((PyObject *) memview);
24464  } else {
24465  PyGILState_STATE _gilstate = PyGILState_Ensure();
24466  Py_INCREF((PyObject *) memview);
24467  PyGILState_Release(_gilstate);
24468  }
24469  }
24470 }
24471 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
24472  int have_gil, int lineno) {
24473  int last_time;
24474  struct __pyx_memoryview_obj *memview = memslice->memview;
24475  if (unlikely(!memview || (PyObject *) memview == Py_None)) {
24476  memslice->memview = NULL;
24477  return;
24478  }
24479  if (unlikely(__pyx_get_slice_count(memview) <= 0))
24480  __pyx_fatalerror("Acquisition count is %d (line %d)",
24481  __pyx_get_slice_count(memview), lineno);
24482  last_time = __pyx_sub_acquisition_count(memview) == 1;
24483  memslice->data = NULL;
24484  if (unlikely(last_time)) {
24485  if (have_gil) {
24486  Py_CLEAR(memslice->memview);
24487  } else {
24488  PyGILState_STATE _gilstate = PyGILState_Ensure();
24489  Py_CLEAR(memslice->memview);
24490  PyGILState_Release(_gilstate);
24491  }
24492  } else {
24493  memslice->memview = NULL;
24494  }
24495 }
24496 
24497 /* Import */
24498 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
24499  PyObject *empty_list = 0;
24500  PyObject *module = 0;
24501  PyObject *global_dict = 0;
24502  PyObject *empty_dict = 0;
24503  PyObject *list;
24504  #if PY_MAJOR_VERSION < 3
24505  PyObject *py_import;
24506  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
24507  if (!py_import)
24508  goto bad;
24509  #endif
24510  if (from_list)
24511  list = from_list;
24512  else {
24513  empty_list = PyList_New(0);
24514  if (!empty_list)
24515  goto bad;
24516  list = empty_list;
24517  }
24518  global_dict = PyModule_GetDict(__pyx_m);
24519  if (!global_dict)
24520  goto bad;
24521  empty_dict = PyDict_New();
24522  if (!empty_dict)
24523  goto bad;
24524  {
24525  #if PY_MAJOR_VERSION >= 3
24526  if (level == -1) {
24527  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
24528  module = PyImport_ImportModuleLevelObject(
24529  name, global_dict, empty_dict, list, 1);
24530  if (!module) {
24531  if (!PyErr_ExceptionMatches(PyExc_ImportError))
24532  goto bad;
24533  PyErr_Clear();
24534  }
24535  }
24536  level = 0;
24537  }
24538  #endif
24539  if (!module) {
24540  #if PY_MAJOR_VERSION < 3
24541  PyObject *py_level = PyInt_FromLong(level);
24542  if (!py_level)
24543  goto bad;
24544  module = PyObject_CallFunctionObjArgs(py_import,
24545  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
24546  Py_DECREF(py_level);
24547  #else
24548  module = PyImport_ImportModuleLevelObject(
24549  name, global_dict, empty_dict, list, level);
24550  #endif
24551  }
24552  }
24553 bad:
24554  #if PY_MAJOR_VERSION < 3
24555  Py_XDECREF(py_import);
24556  #endif
24557  Py_XDECREF(empty_list);
24558  Py_XDECREF(empty_dict);
24559  return module;
24560 }
24561 
24562 /* ImportFrom */
24563 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
24564  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
24565  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
24566  PyErr_Format(PyExc_ImportError,
24567  #if PY_MAJOR_VERSION < 3
24568  "cannot import name %.230s", PyString_AS_STRING(name));
24569  #else
24570  "cannot import name %S", name);
24571  #endif
24572  }
24573  return value;
24574 }
24575 
24576 /* PyFunctionFastCall */
24577 #if CYTHON_FAST_PYCALL
24578 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24579  PyObject *globals) {
24580  PyFrameObject *f;
24581  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24582  PyObject **fastlocals;
24583  Py_ssize_t i;
24584  PyObject *result;
24585  assert(globals != NULL);
24586  /* XXX Perhaps we should create a specialized
24587  PyFrame_New() that doesn't take locals, but does
24588  take builtins without sanity checking them.
24589  */
24590  assert(tstate != NULL);
24591  f = PyFrame_New(tstate, co, globals, NULL);
24592  if (f == NULL) {
24593  return NULL;
24594  }
24595  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
24596  for (i = 0; i < na; i++) {
24597  Py_INCREF(*args);
24598  fastlocals[i] = *args++;
24599  }
24600  result = PyEval_EvalFrameEx(f,0);
24601  ++tstate->recursion_depth;
24602  Py_DECREF(f);
24603  --tstate->recursion_depth;
24604  return result;
24605 }
24606 #if 1 || PY_VERSION_HEX < 0x030600B1
24607 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
24608  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24609  PyObject *globals = PyFunction_GET_GLOBALS(func);
24610  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24611  PyObject *closure;
24612 #if PY_MAJOR_VERSION >= 3
24613  PyObject *kwdefs;
24614 #endif
24615  PyObject *kwtuple, **k;
24616  PyObject **d;
24617  Py_ssize_t nd;
24618  Py_ssize_t nk;
24619  PyObject *result;
24620  assert(kwargs == NULL || PyDict_Check(kwargs));
24621  nk = kwargs ? PyDict_Size(kwargs) : 0;
24622  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
24623  return NULL;
24624  }
24625  if (
24626 #if PY_MAJOR_VERSION >= 3
24627  co->co_kwonlyargcount == 0 &&
24628 #endif
24629  likely(kwargs == NULL || nk == 0) &&
24630  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24631  if (argdefs == NULL && co->co_argcount == nargs) {
24632  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24633  goto done;
24634  }
24635  else if (nargs == 0 && argdefs != NULL
24636  && co->co_argcount == Py_SIZE(argdefs)) {
24637  /* function called with no arguments, but all parameters have
24638  a default value: use default values as arguments .*/
24639  args = &PyTuple_GET_ITEM(argdefs, 0);
24640  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24641  goto done;
24642  }
24643  }
24644  if (kwargs != NULL) {
24645  Py_ssize_t pos, i;
24646  kwtuple = PyTuple_New(2 * nk);
24647  if (kwtuple == NULL) {
24648  result = NULL;
24649  goto done;
24650  }
24651  k = &PyTuple_GET_ITEM(kwtuple, 0);
24652  pos = i = 0;
24653  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
24654  Py_INCREF(k[i]);
24655  Py_INCREF(k[i+1]);
24656  i += 2;
24657  }
24658  nk = i / 2;
24659  }
24660  else {
24661  kwtuple = NULL;
24662  k = NULL;
24663  }
24664  closure = PyFunction_GET_CLOSURE(func);
24665 #if PY_MAJOR_VERSION >= 3
24666  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24667 #endif
24668  if (argdefs != NULL) {
24669  d = &PyTuple_GET_ITEM(argdefs, 0);
24670  nd = Py_SIZE(argdefs);
24671  }
24672  else {
24673  d = NULL;
24674  nd = 0;
24675  }
24676 #if PY_MAJOR_VERSION >= 3
24677  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24678  args, (int)nargs,
24679  k, (int)nk,
24680  d, (int)nd, kwdefs, closure);
24681 #else
24682  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24683  args, (int)nargs,
24684  k, (int)nk,
24685  d, (int)nd, closure);
24686 #endif
24687  Py_XDECREF(kwtuple);
24688 done:
24689  Py_LeaveRecursiveCall();
24690  return result;
24691 }
24692 #endif
24693 #endif
24694 
24695 /* PyObjectCall */
24696 #if CYTHON_COMPILING_IN_CPYTHON
24697 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24698  PyObject *result;
24699  ternaryfunc call = Py_TYPE(func)->tp_call;
24700  if (unlikely(!call))
24701  return PyObject_Call(func, arg, kw);
24702  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24703  return NULL;
24704  result = (*call)(func, arg, kw);
24705  Py_LeaveRecursiveCall();
24706  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24707  PyErr_SetString(
24708  PyExc_SystemError,
24709  "NULL result without error in PyObject_Call");
24710  }
24711  return result;
24712 }
24713 #endif
24714 
24715 /* PyObjectCallMethO */
24716 #if CYTHON_COMPILING_IN_CPYTHON
24717 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24718  PyObject *self, *result;
24719  PyCFunction cfunc;
24720  cfunc = PyCFunction_GET_FUNCTION(func);
24721  self = PyCFunction_GET_SELF(func);
24722  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24723  return NULL;
24724  result = cfunc(self, arg);
24725  Py_LeaveRecursiveCall();
24726  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24727  PyErr_SetString(
24728  PyExc_SystemError,
24729  "NULL result without error in PyObject_Call");
24730  }
24731  return result;
24732 }
24733 #endif
24734 
24735 /* PyObjectCallNoArg */
24736 #if CYTHON_COMPILING_IN_CPYTHON
24737 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
24738 #if CYTHON_FAST_PYCALL
24739  if (PyFunction_Check(func)) {
24740  return __Pyx_PyFunction_FastCall(func, NULL, 0);
24741  }
24742 #endif
24743 #ifdef __Pyx_CyFunction_USED
24744  if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
24745 #else
24746  if (likely(PyCFunction_Check(func)))
24747 #endif
24748  {
24749  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
24750  return __Pyx_PyObject_CallMethO(func, NULL);
24751  }
24752  }
24753  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
24754 }
24755 #endif
24756 
24757 /* PyCFunctionFastCall */
24758 #if CYTHON_FAST_PYCCALL
24759 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24760  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24761  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24762  PyObject *self = PyCFunction_GET_SELF(func);
24763  int flags = PyCFunction_GET_FLAGS(func);
24764  assert(PyCFunction_Check(func));
24765  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
24766  assert(nargs >= 0);
24767  assert(nargs == 0 || args != NULL);
24768  /* _PyCFunction_FastCallDict() must not be called with an exception set,
24769  because it may clear it (directly or indirectly) and so the
24770  caller loses its exception */
24771  assert(!PyErr_Occurred());
24772  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24773  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
24774  } else {
24775  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
24776  }
24777 }
24778 #endif
24779 
24780 /* PyObjectCallOneArg */
24781 #if CYTHON_COMPILING_IN_CPYTHON
24782 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24783  PyObject *result;
24784  PyObject *args = PyTuple_New(1);
24785  if (unlikely(!args)) return NULL;
24786  Py_INCREF(arg);
24787  PyTuple_SET_ITEM(args, 0, arg);
24788  result = __Pyx_PyObject_Call(func, args, NULL);
24789  Py_DECREF(args);
24790  return result;
24791 }
24792 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24793 #if CYTHON_FAST_PYCALL
24794  if (PyFunction_Check(func)) {
24795  return __Pyx_PyFunction_FastCall(func, &arg, 1);
24796  }
24797 #endif
24798  if (likely(PyCFunction_Check(func))) {
24799  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24800  return __Pyx_PyObject_CallMethO(func, arg);
24801 #if CYTHON_FAST_PYCCALL
24802  } else if (__Pyx_PyFastCFunction_Check(func)) {
24803  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24804 #endif
24805  }
24806  }
24807  return __Pyx__PyObject_CallOneArg(func, arg);
24808 }
24809 #else
24810 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24811  PyObject *result;
24812  PyObject *args = PyTuple_Pack(1, arg);
24813  if (unlikely(!args)) return NULL;
24814  result = __Pyx_PyObject_Call(func, args, NULL);
24815  Py_DECREF(args);
24816  return result;
24817 }
24818 #endif
24819 
24820 /* PyErrExceptionMatches */
24821 #if CYTHON_FAST_THREAD_STATE
24822 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24823  Py_ssize_t i, n;
24824  n = PyTuple_GET_SIZE(tuple);
24825 #if PY_MAJOR_VERSION >= 3
24826  for (i=0; i<n; i++) {
24827  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
24828  }
24829 #endif
24830  for (i=0; i<n; i++) {
24831  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
24832  }
24833  return 0;
24834 }
24835 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24836  PyObject *exc_type = tstate->curexc_type;
24837  if (exc_type == err) return 1;
24838  if (unlikely(!exc_type)) return 0;
24839  if (unlikely(PyTuple_Check(err)))
24840  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
24841  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
24842 }
24843 #endif
24844 
24845 /* GetAttr */
24846 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
24847 #if CYTHON_USE_TYPE_SLOTS
24848 #if PY_MAJOR_VERSION >= 3
24849  if (likely(PyUnicode_Check(n)))
24850 #else
24851  if (likely(PyString_Check(n)))
24852 #endif
24853  return __Pyx_PyObject_GetAttrStr(o, n);
24854 #endif
24855  return PyObject_GetAttr(o, n);
24856 }
24857 
24858 /* GetAttr3 */
24859 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
24860  __Pyx_PyThreadState_declare
24861  __Pyx_PyThreadState_assign
24862  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
24863  return NULL;
24864  __Pyx_PyErr_Clear();
24865  Py_INCREF(d);
24866  return d;
24867 }
24868 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
24869  PyObject *r = __Pyx_GetAttr(o, n);
24870  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
24871 }
24872 
24873 /* PyDictVersioning */
24874 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
24875 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
24876  PyObject *dict = Py_TYPE(obj)->tp_dict;
24877  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
24878 }
24879 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
24880  PyObject **dictptr = NULL;
24881  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
24882  if (offset) {
24883 #if CYTHON_COMPILING_IN_CPYTHON
24884  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
24885 #else
24886  dictptr = _PyObject_GetDictPtr(obj);
24887 #endif
24888  }
24889  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
24890 }
24891 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
24892  PyObject *dict = Py_TYPE(obj)->tp_dict;
24893  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
24894  return 0;
24895  return obj_dict_version == __Pyx_get_object_dict_version(obj);
24896 }
24897 #endif
24898 
24899 /* GetModuleGlobalName */
24900 #if CYTHON_USE_DICT_VERSIONS
24901 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
24902 #else
24903 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
24904 #endif
24905 {
24906  PyObject *result;
24907 #if !CYTHON_AVOID_BORROWED_REFS
24908 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
24909  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
24910  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24911  if (likely(result)) {
24912  return __Pyx_NewRef(result);
24913  } else if (unlikely(PyErr_Occurred())) {
24914  return NULL;
24915  }
24916 #else
24917  result = PyDict_GetItem(__pyx_d, name);
24918  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24919  if (likely(result)) {
24920  return __Pyx_NewRef(result);
24921  }
24922 #endif
24923 #else
24924  result = PyObject_GetItem(__pyx_d, name);
24925  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24926  if (likely(result)) {
24927  return __Pyx_NewRef(result);
24928  }
24929  PyErr_Clear();
24930 #endif
24931  return __Pyx_GetBuiltinName(name);
24932 }
24933 
24934 /* KeywordStringCheck */
24935 static int __Pyx_CheckKeywordStrings(
24936  PyObject *kwdict,
24937  const char* function_name,
24938  int kw_allowed)
24939 {
24940  PyObject* key = 0;
24941  Py_ssize_t pos = 0;
24942 #if CYTHON_COMPILING_IN_PYPY
24943  if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
24944  goto invalid_keyword;
24945  return 1;
24946 #else
24947  while (PyDict_Next(kwdict, &pos, &key, 0)) {
24948  #if PY_MAJOR_VERSION < 3
24949  if (unlikely(!PyString_Check(key)))
24950  #endif
24951  if (unlikely(!PyUnicode_Check(key)))
24952  goto invalid_keyword_type;
24953  }
24954  if ((!kw_allowed) && unlikely(key))
24955  goto invalid_keyword;
24956  return 1;
24957 invalid_keyword_type:
24958  PyErr_Format(PyExc_TypeError,
24959  "%.200s() keywords must be strings", function_name);
24960  return 0;
24961 #endif
24962 invalid_keyword:
24963  PyErr_Format(PyExc_TypeError,
24964  #if PY_MAJOR_VERSION < 3
24965  "%.200s() got an unexpected keyword argument '%.200s'",
24966  function_name, PyString_AsString(key));
24967  #else
24968  "%s() got an unexpected keyword argument '%U'",
24969  function_name, key);
24970  #endif
24971  return 0;
24972 }
24973 
24974 /* WriteUnraisableException */
24975 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
24976  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
24977  int full_traceback, CYTHON_UNUSED int nogil) {
24978  PyObject *old_exc, *old_val, *old_tb;
24979  PyObject *ctx;
24980  __Pyx_PyThreadState_declare
24981 #ifdef WITH_THREAD
24982  PyGILState_STATE state;
24983  if (nogil)
24984  state = PyGILState_Ensure();
24985 #ifdef _MSC_VER
24986  else state = (PyGILState_STATE)-1;
24987 #endif
24988 #endif
24989  __Pyx_PyThreadState_assign
24990  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
24991  if (full_traceback) {
24992  Py_XINCREF(old_exc);
24993  Py_XINCREF(old_val);
24994  Py_XINCREF(old_tb);
24995  __Pyx_ErrRestore(old_exc, old_val, old_tb);
24996  PyErr_PrintEx(1);
24997  }
24998  #if PY_MAJOR_VERSION < 3
24999  ctx = PyString_FromString(name);
25000  #else
25001  ctx = PyUnicode_FromString(name);
25002  #endif
25003  __Pyx_ErrRestore(old_exc, old_val, old_tb);
25004  if (!ctx) {
25005  PyErr_WriteUnraisable(Py_None);
25006  } else {
25007  PyErr_WriteUnraisable(ctx);
25008  Py_DECREF(ctx);
25009  }
25010 #ifdef WITH_THREAD
25011  if (nogil)
25012  PyGILState_Release(state);
25013 #endif
25014 }
25015 
25016 /* None */
25017 static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
25018  PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
25019 }
25020 
25021 /* FetchCommonType */
25022 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
25023  PyObject* fake_module;
25024  PyTypeObject* cached_type = NULL;
25025  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
25026  if (!fake_module) return NULL;
25027  Py_INCREF(fake_module);
25028  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
25029  if (cached_type) {
25030  if (!PyType_Check((PyObject*)cached_type)) {
25031  PyErr_Format(PyExc_TypeError,
25032  "Shared Cython type %.200s is not a type object",
25033  type->tp_name);
25034  goto bad;
25035  }
25036  if (cached_type->tp_basicsize != type->tp_basicsize) {
25037  PyErr_Format(PyExc_TypeError,
25038  "Shared Cython type %.200s has the wrong size, try recompiling",
25039  type->tp_name);
25040  goto bad;
25041  }
25042  } else {
25043  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
25044  PyErr_Clear();
25045  if (PyType_Ready(type) < 0) goto bad;
25046  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
25047  goto bad;
25048  Py_INCREF(type);
25049  cached_type = type;
25050  }
25051 done:
25052  Py_DECREF(fake_module);
25053  return cached_type;
25054 bad:
25055  Py_XDECREF(cached_type);
25056  cached_type = NULL;
25057  goto done;
25058 }
25059 
25060 /* CythonFunctionShared */
25061 #include <structmember.h>
25062 static PyObject *
25063 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
25064 {
25065  if (unlikely(op->func_doc == NULL)) {
25066  if (op->func.m_ml->ml_doc) {
25067 #if PY_MAJOR_VERSION >= 3
25068  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
25069 #else
25070  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
25071 #endif
25072  if (unlikely(op->func_doc == NULL))
25073  return NULL;
25074  } else {
25075  Py_INCREF(Py_None);
25076  return Py_None;
25077  }
25078  }
25079  Py_INCREF(op->func_doc);
25080  return op->func_doc;
25081 }
25082 static int
25083 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25084 {
25085  PyObject *tmp = op->func_doc;
25086  if (value == NULL) {
25087  value = Py_None;
25088  }
25089  Py_INCREF(value);
25090  op->func_doc = value;
25091  Py_XDECREF(tmp);
25092  return 0;
25093 }
25094 static PyObject *
25095 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25096 {
25097  if (unlikely(op->func_name == NULL)) {
25098 #if PY_MAJOR_VERSION >= 3
25099  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
25100 #else
25101  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
25102 #endif
25103  if (unlikely(op->func_name == NULL))
25104  return NULL;
25105  }
25106  Py_INCREF(op->func_name);
25107  return op->func_name;
25108 }
25109 static int
25110 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25111 {
25112  PyObject *tmp;
25113 #if PY_MAJOR_VERSION >= 3
25114  if (unlikely(value == NULL || !PyUnicode_Check(value)))
25115 #else
25116  if (unlikely(value == NULL || !PyString_Check(value)))
25117 #endif
25118  {
25119  PyErr_SetString(PyExc_TypeError,
25120  "__name__ must be set to a string object");
25121  return -1;
25122  }
25123  tmp = op->func_name;
25124  Py_INCREF(value);
25125  op->func_name = value;
25126  Py_XDECREF(tmp);
25127  return 0;
25128 }
25129 static PyObject *
25130 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25131 {
25132  Py_INCREF(op->func_qualname);
25133  return op->func_qualname;
25134 }
25135 static int
25136 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25137 {
25138  PyObject *tmp;
25139 #if PY_MAJOR_VERSION >= 3
25140  if (unlikely(value == NULL || !PyUnicode_Check(value)))
25141 #else
25142  if (unlikely(value == NULL || !PyString_Check(value)))
25143 #endif
25144  {
25145  PyErr_SetString(PyExc_TypeError,
25146  "__qualname__ must be set to a string object");
25147  return -1;
25148  }
25149  tmp = op->func_qualname;
25150  Py_INCREF(value);
25151  op->func_qualname = value;
25152  Py_XDECREF(tmp);
25153  return 0;
25154 }
25155 static PyObject *
25156 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
25157 {
25158  PyObject *self;
25159  self = m->func_closure;
25160  if (self == NULL)
25161  self = Py_None;
25162  Py_INCREF(self);
25163  return self;
25164 }
25165 static PyObject *
25166 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25167 {
25168  if (unlikely(op->func_dict == NULL)) {
25169  op->func_dict = PyDict_New();
25170  if (unlikely(op->func_dict == NULL))
25171  return NULL;
25172  }
25173  Py_INCREF(op->func_dict);
25174  return op->func_dict;
25175 }
25176 static int
25177 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25178 {
25179  PyObject *tmp;
25180  if (unlikely(value == NULL)) {
25181  PyErr_SetString(PyExc_TypeError,
25182  "function's dictionary may not be deleted");
25183  return -1;
25184  }
25185  if (unlikely(!PyDict_Check(value))) {
25186  PyErr_SetString(PyExc_TypeError,
25187  "setting function's dictionary to a non-dict");
25188  return -1;
25189  }
25190  tmp = op->func_dict;
25191  Py_INCREF(value);
25192  op->func_dict = value;
25193  Py_XDECREF(tmp);
25194  return 0;
25195 }
25196 static PyObject *
25197 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25198 {
25199  Py_INCREF(op->func_globals);
25200  return op->func_globals;
25201 }
25202 static PyObject *
25203 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25204 {
25205  Py_INCREF(Py_None);
25206  return Py_None;
25207 }
25208 static PyObject *
25209 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25210 {
25211  PyObject* result = (op->func_code) ? op->func_code : Py_None;
25212  Py_INCREF(result);
25213  return result;
25214 }
25215 static int
25216 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
25217  int result = 0;
25218  PyObject *res = op->defaults_getter((PyObject *) op);
25219  if (unlikely(!res))
25220  return -1;
25221  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25222  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
25223  Py_INCREF(op->defaults_tuple);
25224  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
25225  Py_INCREF(op->defaults_kwdict);
25226  #else
25227  op->defaults_tuple = PySequence_ITEM(res, 0);
25228  if (unlikely(!op->defaults_tuple)) result = -1;
25229  else {
25230  op->defaults_kwdict = PySequence_ITEM(res, 1);
25231  if (unlikely(!op->defaults_kwdict)) result = -1;
25232  }
25233  #endif
25234  Py_DECREF(res);
25235  return result;
25236 }
25237 static int
25238 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
25239  PyObject* tmp;
25240  if (!value) {
25241  value = Py_None;
25242  } else if (value != Py_None && !PyTuple_Check(value)) {
25243  PyErr_SetString(PyExc_TypeError,
25244  "__defaults__ must be set to a tuple object");
25245  return -1;
25246  }
25247  Py_INCREF(value);
25248  tmp = op->defaults_tuple;
25249  op->defaults_tuple = value;
25250  Py_XDECREF(tmp);
25251  return 0;
25252 }
25253 static PyObject *
25254 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
25255  PyObject* result = op->defaults_tuple;
25256  if (unlikely(!result)) {
25257  if (op->defaults_getter) {
25258  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
25259  result = op->defaults_tuple;
25260  } else {
25261  result = Py_None;
25262  }
25263  }
25264  Py_INCREF(result);
25265  return result;
25266 }
25267 static int
25268 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
25269  PyObject* tmp;
25270  if (!value) {
25271  value = Py_None;
25272  } else if (value != Py_None && !PyDict_Check(value)) {
25273  PyErr_SetString(PyExc_TypeError,
25274  "__kwdefaults__ must be set to a dict object");
25275  return -1;
25276  }
25277  Py_INCREF(value);
25278  tmp = op->defaults_kwdict;
25279  op->defaults_kwdict = value;
25280  Py_XDECREF(tmp);
25281  return 0;
25282 }
25283 static PyObject *
25284 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
25285  PyObject* result = op->defaults_kwdict;
25286  if (unlikely(!result)) {
25287  if (op->defaults_getter) {
25288  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
25289  result = op->defaults_kwdict;
25290  } else {
25291  result = Py_None;
25292  }
25293  }
25294  Py_INCREF(result);
25295  return result;
25296 }
25297 static int
25298 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
25299  PyObject* tmp;
25300  if (!value || value == Py_None) {
25301  value = NULL;
25302  } else if (!PyDict_Check(value)) {
25303  PyErr_SetString(PyExc_TypeError,
25304  "__annotations__ must be set to a dict object");
25305  return -1;
25306  }
25307  Py_XINCREF(value);
25308  tmp = op->func_annotations;
25309  op->func_annotations = value;
25310  Py_XDECREF(tmp);
25311  return 0;
25312 }
25313 static PyObject *
25314 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
25315  PyObject* result = op->func_annotations;
25316  if (unlikely(!result)) {
25317  result = PyDict_New();
25318  if (unlikely(!result)) return NULL;
25319  op->func_annotations = result;
25320  }
25321  Py_INCREF(result);
25322  return result;
25323 }
25324 static PyGetSetDef __pyx_CyFunction_getsets[] = {
25325  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25326  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25327  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25328  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25329  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
25330  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
25331  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25332  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25333  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25334  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25335  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25336  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25337  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25338  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25339  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25340  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25341  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
25342  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
25343  {0, 0, 0, 0, 0}
25344 };
25345 static PyMemberDef __pyx_CyFunction_members[] = {
25346  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
25347  {0, 0, 0, 0, 0}
25348 };
25349 static PyObject *
25350 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
25351 {
25352 #if PY_MAJOR_VERSION >= 3
25353  Py_INCREF(m->func_qualname);
25354  return m->func_qualname;
25355 #else
25356  return PyString_FromString(m->func.m_ml->ml_name);
25357 #endif
25358 }
25359 static PyMethodDef __pyx_CyFunction_methods[] = {
25360  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
25361  {0, 0, 0, 0}
25362 };
25363 #if PY_VERSION_HEX < 0x030500A0
25364 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
25365 #else
25366 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
25367 #endif
25368 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
25369  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25370  if (unlikely(op == NULL))
25371  return NULL;
25372  op->flags = flags;
25373  __Pyx_CyFunction_weakreflist(op) = NULL;
25374  op->func.m_ml = ml;
25375  op->func.m_self = (PyObject *) op;
25376  Py_XINCREF(closure);
25377  op->func_closure = closure;
25378  Py_XINCREF(module);
25379  op->func.m_module = module;
25380  op->func_dict = NULL;
25381  op->func_name = NULL;
25382  Py_INCREF(qualname);
25383  op->func_qualname = qualname;
25384  op->func_doc = NULL;
25385  op->func_classobj = NULL;
25386  op->func_globals = globals;
25387  Py_INCREF(op->func_globals);
25388  Py_XINCREF(code);
25389  op->func_code = code;
25390  op->defaults_pyobjects = 0;
25391  op->defaults_size = 0;
25392  op->defaults = NULL;
25393  op->defaults_tuple = NULL;
25394  op->defaults_kwdict = NULL;
25395  op->defaults_getter = NULL;
25396  op->func_annotations = NULL;
25397  return (PyObject *) op;
25398 }
25399 static int
25400 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
25401 {
25402  Py_CLEAR(m->func_closure);
25403  Py_CLEAR(m->func.m_module);
25404  Py_CLEAR(m->func_dict);
25405  Py_CLEAR(m->func_name);
25406  Py_CLEAR(m->func_qualname);
25407  Py_CLEAR(m->func_doc);
25408  Py_CLEAR(m->func_globals);
25409  Py_CLEAR(m->func_code);
25410  Py_CLEAR(m->func_classobj);
25411  Py_CLEAR(m->defaults_tuple);
25412  Py_CLEAR(m->defaults_kwdict);
25413  Py_CLEAR(m->func_annotations);
25414  if (m->defaults) {
25415  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25416  int i;
25417  for (i = 0; i < m->defaults_pyobjects; i++)
25418  Py_XDECREF(pydefaults[i]);
25419  PyObject_Free(m->defaults);
25420  m->defaults = NULL;
25421  }
25422  return 0;
25423 }
25424 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
25425 {
25426  if (__Pyx_CyFunction_weakreflist(m) != NULL)
25427  PyObject_ClearWeakRefs((PyObject *) m);
25428  __Pyx_CyFunction_clear(m);
25429  PyObject_GC_Del(m);
25430 }
25431 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
25432 {
25433  PyObject_GC_UnTrack(m);
25434  __Pyx__CyFunction_dealloc(m);
25435 }
25436 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
25437 {
25438  Py_VISIT(m->func_closure);
25439  Py_VISIT(m->func.m_module);
25440  Py_VISIT(m->func_dict);
25441  Py_VISIT(m->func_name);
25442  Py_VISIT(m->func_qualname);
25443  Py_VISIT(m->func_doc);
25444  Py_VISIT(m->func_globals);
25445  Py_VISIT(m->func_code);
25446  Py_VISIT(m->func_classobj);
25447  Py_VISIT(m->defaults_tuple);
25448  Py_VISIT(m->defaults_kwdict);
25449  if (m->defaults) {
25450  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25451  int i;
25452  for (i = 0; i < m->defaults_pyobjects; i++)
25453  Py_VISIT(pydefaults[i]);
25454  }
25455  return 0;
25456 }
25457 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
25458 {
25459 #if PY_MAJOR_VERSION < 3
25460  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25461  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
25462  Py_INCREF(func);
25463  return func;
25464  }
25465  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
25466  if (type == NULL)
25467  type = (PyObject *)(Py_TYPE(obj));
25468  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
25469  }
25470  if (obj == Py_None)
25471  obj = NULL;
25472 #endif
25473  return __Pyx_PyMethod_New(func, obj, type);
25474 }
25475 static PyObject*
25476 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
25477 {
25478 #if PY_MAJOR_VERSION >= 3
25479  return PyUnicode_FromFormat("<cyfunction %U at %p>",
25480  op->func_qualname, (void *)op);
25481 #else
25482  return PyString_FromFormat("<cyfunction %s at %p>",
25483  PyString_AsString(op->func_qualname), (void *)op);
25484 #endif
25485 }
25486 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
25487  PyCFunctionObject* f = (PyCFunctionObject*)func;
25488  PyCFunction meth = f->m_ml->ml_meth;
25489  Py_ssize_t size;
25490  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
25491  case METH_VARARGS:
25492  if (likely(kw == NULL || PyDict_Size(kw) == 0))
25493  return (*meth)(self, arg);
25494  break;
25495  case METH_VARARGS | METH_KEYWORDS:
25496  return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
25497  case METH_NOARGS:
25498  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25499  size = PyTuple_GET_SIZE(arg);
25500  if (likely(size == 0))
25501  return (*meth)(self, NULL);
25502  PyErr_Format(PyExc_TypeError,
25503  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
25504  f->m_ml->ml_name, size);
25505  return NULL;
25506  }
25507  break;
25508  case METH_O:
25509  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25510  size = PyTuple_GET_SIZE(arg);
25511  if (likely(size == 1)) {
25512  PyObject *result, *arg0;
25513  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25514  arg0 = PyTuple_GET_ITEM(arg, 0);
25515  #else
25516  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
25517  #endif
25518  result = (*meth)(self, arg0);
25519  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
25520  Py_DECREF(arg0);
25521  #endif
25522  return result;
25523  }
25524  PyErr_Format(PyExc_TypeError,
25525  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
25526  f->m_ml->ml_name, size);
25527  return NULL;
25528  }
25529  break;
25530  default:
25531  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
25532  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
25533  "longer supported!");
25534  return NULL;
25535  }
25536  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
25537  f->m_ml->ml_name);
25538  return NULL;
25539 }
25540 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
25541  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
25542 }
25543 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
25544  PyObject *result;
25545  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
25546  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
25547  Py_ssize_t argc;
25548  PyObject *new_args;
25549  PyObject *self;
25550  argc = PyTuple_GET_SIZE(args);
25551  new_args = PyTuple_GetSlice(args, 1, argc);
25552  if (unlikely(!new_args))
25553  return NULL;
25554  self = PyTuple_GetItem(args, 0);
25555  if (unlikely(!self)) {
25556  Py_DECREF(new_args);
25557  return NULL;
25558  }
25559  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
25560  Py_DECREF(new_args);
25561  } else {
25562  result = __Pyx_CyFunction_Call(func, args, kw);
25563  }
25564  return result;
25565 }
25566 static PyTypeObject __pyx_CyFunctionType_type = {
25567  PyVarObject_HEAD_INIT(0, 0)
25568  "cython_function_or_method",
25569  sizeof(__pyx_CyFunctionObject),
25570  0,
25571  (destructor) __Pyx_CyFunction_dealloc,
25572  0,
25573  0,
25574  0,
25575 #if PY_MAJOR_VERSION < 3
25576  0,
25577 #else
25578  0,
25579 #endif
25580  (reprfunc) __Pyx_CyFunction_repr,
25581  0,
25582  0,
25583  0,
25584  0,
25585  __Pyx_CyFunction_CallAsMethod,
25586  0,
25587  0,
25588  0,
25589  0,
25590  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
25591  0,
25592  (traverseproc) __Pyx_CyFunction_traverse,
25593  (inquiry) __Pyx_CyFunction_clear,
25594  0,
25595 #if PY_VERSION_HEX < 0x030500A0
25596  offsetof(__pyx_CyFunctionObject, func_weakreflist),
25597 #else
25598  offsetof(PyCFunctionObject, m_weakreflist),
25599 #endif
25600  0,
25601  0,
25602  __pyx_CyFunction_methods,
25603  __pyx_CyFunction_members,
25604  __pyx_CyFunction_getsets,
25605  0,
25606  0,
25607  __Pyx_CyFunction_descr_get,
25608  0,
25609  offsetof(__pyx_CyFunctionObject, func_dict),
25610  0,
25611  0,
25612  0,
25613  0,
25614  0,
25615  0,
25616  0,
25617  0,
25618  0,
25619  0,
25620  0,
25621  0,
25622 #if PY_VERSION_HEX >= 0x030400a1
25623  0,
25624 #endif
25625 #if PY_VERSION_HEX >= 0x030800b1
25626  0,
25627 #endif
25628 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
25629  0,
25630 #endif
25631 };
25632 static int __pyx_CyFunction_init(void) {
25633  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
25634  if (unlikely(__pyx_CyFunctionType == NULL)) {
25635  return -1;
25636  }
25637  return 0;
25638 }
25639 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
25640  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25641  m->defaults = PyObject_Malloc(size);
25642  if (unlikely(!m->defaults))
25643  return PyErr_NoMemory();
25644  memset(m->defaults, 0, size);
25645  m->defaults_pyobjects = pyobjects;
25646  m->defaults_size = size;
25647  return m->defaults;
25648 }
25649 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
25650  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25651  m->defaults_tuple = tuple;
25652  Py_INCREF(tuple);
25653 }
25654 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
25655  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25656  m->defaults_kwdict = dict;
25657  Py_INCREF(dict);
25658 }
25659 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
25660  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25661  m->func_annotations = dict;
25662  Py_INCREF(dict);
25663 }
25664 
25665 /* CythonFunction */
25666 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
25667  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25668  PyObject *op = __Pyx_CyFunction_Init(
25669  PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
25670  ml, flags, qualname, closure, module, globals, code
25671  );
25672  if (likely(op)) {
25673  PyObject_GC_Track(op);
25674  }
25675  return op;
25676 }
25677 
25678 /* PyObjectCall2Args */
25679 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
25680  PyObject *args, *result = NULL;
25681  #if CYTHON_FAST_PYCALL
25682  if (PyFunction_Check(function)) {
25683  PyObject *args[2] = {arg1, arg2};
25684  return __Pyx_PyFunction_FastCall(function, args, 2);
25685  }
25686  #endif
25687  #if CYTHON_FAST_PYCCALL
25688  if (__Pyx_PyFastCFunction_Check(function)) {
25689  PyObject *args[2] = {arg1, arg2};
25690  return __Pyx_PyCFunction_FastCall(function, args, 2);
25691  }
25692  #endif
25693  args = PyTuple_New(2);
25694  if (unlikely(!args)) goto done;
25695  Py_INCREF(arg1);
25696  PyTuple_SET_ITEM(args, 0, arg1);
25697  Py_INCREF(arg2);
25698  PyTuple_SET_ITEM(args, 1, arg2);
25699  Py_INCREF(function);
25700  result = __Pyx_PyObject_Call(function, args, NULL);
25701  Py_DECREF(args);
25702  Py_DECREF(function);
25703 done:
25704  return result;
25705 }
25706 
25707 /* SliceObject */
25708 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
25709  Py_ssize_t cstart, Py_ssize_t cstop,
25710  PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
25711  int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
25712 #if CYTHON_USE_TYPE_SLOTS
25713  PyMappingMethods* mp;
25714 #if PY_MAJOR_VERSION < 3
25715  PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
25716  if (likely(ms && ms->sq_slice)) {
25717  if (!has_cstart) {
25718  if (_py_start && (*_py_start != Py_None)) {
25719  cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
25720  if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
25721  } else
25722  cstart = 0;
25723  }
25724  if (!has_cstop) {
25725  if (_py_stop && (*_py_stop != Py_None)) {
25726  cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
25727  if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
25728  } else
25729  cstop = PY_SSIZE_T_MAX;
25730  }
25731  if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
25732  Py_ssize_t l = ms->sq_length(obj);
25733  if (likely(l >= 0)) {
25734  if (cstop < 0) {
25735  cstop += l;
25736  if (cstop < 0) cstop = 0;
25737  }
25738  if (cstart < 0) {
25739  cstart += l;
25740  if (cstart < 0) cstart = 0;
25741  }
25742  } else {
25743  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
25744  goto bad;
25745  PyErr_Clear();
25746  }
25747  }
25748  return ms->sq_slice(obj, cstart, cstop);
25749  }
25750 #endif
25751  mp = Py_TYPE(obj)->tp_as_mapping;
25752  if (likely(mp && mp->mp_subscript))
25753 #endif
25754  {
25755  PyObject* result;
25756  PyObject *py_slice, *py_start, *py_stop;
25757  if (_py_slice) {
25758  py_slice = *_py_slice;
25759  } else {
25760  PyObject* owned_start = NULL;
25761  PyObject* owned_stop = NULL;
25762  if (_py_start) {
25763  py_start = *_py_start;
25764  } else {
25765  if (has_cstart) {
25766  owned_start = py_start = PyInt_FromSsize_t(cstart);
25767  if (unlikely(!py_start)) goto bad;
25768  } else
25769  py_start = Py_None;
25770  }
25771  if (_py_stop) {
25772  py_stop = *_py_stop;
25773  } else {
25774  if (has_cstop) {
25775  owned_stop = py_stop = PyInt_FromSsize_t(cstop);
25776  if (unlikely(!py_stop)) {
25777  Py_XDECREF(owned_start);
25778  goto bad;
25779  }
25780  } else
25781  py_stop = Py_None;
25782  }
25783  py_slice = PySlice_New(py_start, py_stop, Py_None);
25784  Py_XDECREF(owned_start);
25785  Py_XDECREF(owned_stop);
25786  if (unlikely(!py_slice)) goto bad;
25787  }
25788 #if CYTHON_USE_TYPE_SLOTS
25789  result = mp->mp_subscript(obj, py_slice);
25790 #else
25791  result = PyObject_GetItem(obj, py_slice);
25792 #endif
25793  if (!_py_slice) {
25794  Py_DECREF(py_slice);
25795  }
25796  return result;
25797  }
25798  PyErr_Format(PyExc_TypeError,
25799  "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
25800 bad:
25801  return NULL;
25802 }
25803 
25804 /* RaiseException */
25805 #if PY_MAJOR_VERSION < 3
25806 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
25807  CYTHON_UNUSED PyObject *cause) {
25808  __Pyx_PyThreadState_declare
25809  Py_XINCREF(type);
25810  if (!value || value == Py_None)
25811  value = NULL;
25812  else
25813  Py_INCREF(value);
25814  if (!tb || tb == Py_None)
25815  tb = NULL;
25816  else {
25817  Py_INCREF(tb);
25818  if (!PyTraceBack_Check(tb)) {
25819  PyErr_SetString(PyExc_TypeError,
25820  "raise: arg 3 must be a traceback or None");
25821  goto raise_error;
25822  }
25823  }
25824  if (PyType_Check(type)) {
25825 #if CYTHON_COMPILING_IN_PYPY
25826  if (!value) {
25827  Py_INCREF(Py_None);
25828  value = Py_None;
25829  }
25830 #endif
25831  PyErr_NormalizeException(&type, &value, &tb);
25832  } else {
25833  if (value) {
25834  PyErr_SetString(PyExc_TypeError,
25835  "instance exception may not have a separate value");
25836  goto raise_error;
25837  }
25838  value = type;
25839  type = (PyObject*) Py_TYPE(type);
25840  Py_INCREF(type);
25841  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
25842  PyErr_SetString(PyExc_TypeError,
25843  "raise: exception class must be a subclass of BaseException");
25844  goto raise_error;
25845  }
25846  }
25847  __Pyx_PyThreadState_assign
25848  __Pyx_ErrRestore(type, value, tb);
25849  return;
25850 raise_error:
25851  Py_XDECREF(value);
25852  Py_XDECREF(type);
25853  Py_XDECREF(tb);
25854  return;
25855 }
25856 #else
25857 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
25858  PyObject* owned_instance = NULL;
25859  if (tb == Py_None) {
25860  tb = 0;
25861  } else if (tb && !PyTraceBack_Check(tb)) {
25862  PyErr_SetString(PyExc_TypeError,
25863  "raise: arg 3 must be a traceback or None");
25864  goto bad;
25865  }
25866  if (value == Py_None)
25867  value = 0;
25868  if (PyExceptionInstance_Check(type)) {
25869  if (value) {
25870  PyErr_SetString(PyExc_TypeError,
25871  "instance exception may not have a separate value");
25872  goto bad;
25873  }
25874  value = type;
25875  type = (PyObject*) Py_TYPE(value);
25876  } else if (PyExceptionClass_Check(type)) {
25877  PyObject *instance_class = NULL;
25878  if (value && PyExceptionInstance_Check(value)) {
25879  instance_class = (PyObject*) Py_TYPE(value);
25880  if (instance_class != type) {
25881  int is_subclass = PyObject_IsSubclass(instance_class, type);
25882  if (!is_subclass) {
25883  instance_class = NULL;
25884  } else if (unlikely(is_subclass == -1)) {
25885  goto bad;
25886  } else {
25887  type = instance_class;
25888  }
25889  }
25890  }
25891  if (!instance_class) {
25892  PyObject *args;
25893  if (!value)
25894  args = PyTuple_New(0);
25895  else if (PyTuple_Check(value)) {
25896  Py_INCREF(value);
25897  args = value;
25898  } else
25899  args = PyTuple_Pack(1, value);
25900  if (!args)
25901  goto bad;
25902  owned_instance = PyObject_Call(type, args, NULL);
25903  Py_DECREF(args);
25904  if (!owned_instance)
25905  goto bad;
25906  value = owned_instance;
25907  if (!PyExceptionInstance_Check(value)) {
25908  PyErr_Format(PyExc_TypeError,
25909  "calling %R should have returned an instance of "
25910  "BaseException, not %R",
25911  type, Py_TYPE(value));
25912  goto bad;
25913  }
25914  }
25915  } else {
25916  PyErr_SetString(PyExc_TypeError,
25917  "raise: exception class must be a subclass of BaseException");
25918  goto bad;
25919  }
25920  if (cause) {
25921  PyObject *fixed_cause;
25922  if (cause == Py_None) {
25923  fixed_cause = NULL;
25924  } else if (PyExceptionClass_Check(cause)) {
25925  fixed_cause = PyObject_CallObject(cause, NULL);
25926  if (fixed_cause == NULL)
25927  goto bad;
25928  } else if (PyExceptionInstance_Check(cause)) {
25929  fixed_cause = cause;
25930  Py_INCREF(fixed_cause);
25931  } else {
25932  PyErr_SetString(PyExc_TypeError,
25933  "exception causes must derive from "
25934  "BaseException");
25935  goto bad;
25936  }
25937  PyException_SetCause(value, fixed_cause);
25938  }
25939  PyErr_SetObject(type, value);
25940  if (tb) {
25941 #if CYTHON_COMPILING_IN_PYPY
25942  PyObject *tmp_type, *tmp_value, *tmp_tb;
25943  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
25944  Py_INCREF(tb);
25945  PyErr_Restore(tmp_type, tmp_value, tb);
25946  Py_XDECREF(tmp_tb);
25947 #else
25948  PyThreadState *tstate = __Pyx_PyThreadState_Current;
25949  PyObject* tmp_tb = tstate->curexc_traceback;
25950  if (tb != tmp_tb) {
25951  Py_INCREF(tb);
25952  tstate->curexc_traceback = tb;
25953  Py_XDECREF(tmp_tb);
25954  }
25955 #endif
25956  }
25957 bad:
25958  Py_XDECREF(owned_instance);
25959  return;
25960 }
25961 #endif
25962 
25963 /* HasAttr */
25964 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
25965  PyObject *r;
25966  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
25967  PyErr_SetString(PyExc_TypeError,
25968  "hasattr(): attribute name must be string");
25969  return -1;
25970  }
25971  r = __Pyx_GetAttr(o, n);
25972  if (unlikely(!r)) {
25973  PyErr_Clear();
25974  return 0;
25975  } else {
25976  Py_DECREF(r);
25977  return 1;
25978  }
25979 }
25980 
25981 /* GetTopmostException */
25982 #if CYTHON_USE_EXC_INFO_STACK
25983 static _PyErr_StackItem *
25984 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
25985 {
25986  _PyErr_StackItem *exc_info = tstate->exc_info;
25987  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
25988  exc_info->previous_item != NULL)
25989  {
25990  exc_info = exc_info->previous_item;
25991  }
25992  return exc_info;
25993 }
25994 #endif
25995 
25996 /* SaveResetException */
25997 #if CYTHON_FAST_THREAD_STATE
25998 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25999  #if CYTHON_USE_EXC_INFO_STACK
26000  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
26001  *type = exc_info->exc_type;
26002  *value = exc_info->exc_value;
26003  *tb = exc_info->exc_traceback;
26004  #else
26005  *type = tstate->exc_type;
26006  *value = tstate->exc_value;
26007  *tb = tstate->exc_traceback;
26008  #endif
26009  Py_XINCREF(*type);
26010  Py_XINCREF(*value);
26011  Py_XINCREF(*tb);
26012 }
26013 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
26014  PyObject *tmp_type, *tmp_value, *tmp_tb;
26015  #if CYTHON_USE_EXC_INFO_STACK
26016  _PyErr_StackItem *exc_info = tstate->exc_info;
26017  tmp_type = exc_info->exc_type;
26018  tmp_value = exc_info->exc_value;
26019  tmp_tb = exc_info->exc_traceback;
26020  exc_info->exc_type = type;
26021  exc_info->exc_value = value;
26022  exc_info->exc_traceback = tb;
26023  #else
26024  tmp_type = tstate->exc_type;
26025  tmp_value = tstate->exc_value;
26026  tmp_tb = tstate->exc_traceback;
26027  tstate->exc_type = type;
26028  tstate->exc_value = value;
26029  tstate->exc_traceback = tb;
26030  #endif
26031  Py_XDECREF(tmp_type);
26032  Py_XDECREF(tmp_value);
26033  Py_XDECREF(tmp_tb);
26034 }
26035 #endif
26036 
26037 /* GetException */
26038 #if CYTHON_FAST_THREAD_STATE
26039 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
26040 #else
26041 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
26042 #endif
26043 {
26044  PyObject *local_type, *local_value, *local_tb;
26045 #if CYTHON_FAST_THREAD_STATE
26046  PyObject *tmp_type, *tmp_value, *tmp_tb;
26047  local_type = tstate->curexc_type;
26048  local_value = tstate->curexc_value;
26049  local_tb = tstate->curexc_traceback;
26050  tstate->curexc_type = 0;
26051  tstate->curexc_value = 0;
26052  tstate->curexc_traceback = 0;
26053 #else
26054  PyErr_Fetch(&local_type, &local_value, &local_tb);
26055 #endif
26056  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
26057 #if CYTHON_FAST_THREAD_STATE
26058  if (unlikely(tstate->curexc_type))
26059 #else
26060  if (unlikely(PyErr_Occurred()))
26061 #endif
26062  goto bad;
26063  #if PY_MAJOR_VERSION >= 3
26064  if (local_tb) {
26065  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
26066  goto bad;
26067  }
26068  #endif
26069  Py_XINCREF(local_tb);
26070  Py_XINCREF(local_type);
26071  Py_XINCREF(local_value);
26072  *type = local_type;
26073  *value = local_value;
26074  *tb = local_tb;
26075 #if CYTHON_FAST_THREAD_STATE
26076  #if CYTHON_USE_EXC_INFO_STACK
26077  {
26078  _PyErr_StackItem *exc_info = tstate->exc_info;
26079  tmp_type = exc_info->exc_type;
26080  tmp_value = exc_info->exc_value;
26081  tmp_tb = exc_info->exc_traceback;
26082  exc_info->exc_type = local_type;
26083  exc_info->exc_value = local_value;
26084  exc_info->exc_traceback = local_tb;
26085  }
26086  #else
26087  tmp_type = tstate->exc_type;
26088  tmp_value = tstate->exc_value;
26089  tmp_tb = tstate->exc_traceback;
26090  tstate->exc_type = local_type;
26091  tstate->exc_value = local_value;
26092  tstate->exc_traceback = local_tb;
26093  #endif
26094  Py_XDECREF(tmp_type);
26095  Py_XDECREF(tmp_value);
26096  Py_XDECREF(tmp_tb);
26097 #else
26098  PyErr_SetExcInfo(local_type, local_value, local_tb);
26099 #endif
26100  return 0;
26101 bad:
26102  *type = 0;
26103  *value = 0;
26104  *tb = 0;
26105  Py_XDECREF(local_type);
26106  Py_XDECREF(local_value);
26107  Py_XDECREF(local_tb);
26108  return -1;
26109 }
26110 
26111 /* ArgTypeTest */
26112 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
26113 {
26114  if (unlikely(!type)) {
26115  PyErr_SetString(PyExc_SystemError, "Missing type object");
26116  return 0;
26117  }
26118  else if (exact) {
26119  #if PY_MAJOR_VERSION == 2
26120  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
26121  #endif
26122  }
26123  else {
26124  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
26125  }
26126  PyErr_Format(PyExc_TypeError,
26127  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
26128  name, type->tp_name, Py_TYPE(obj)->tp_name);
26129  return 0;
26130 }
26131 
26132 /* BytesEquals */
26133 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
26134 #if CYTHON_COMPILING_IN_PYPY
26135  return PyObject_RichCompareBool(s1, s2, equals);
26136 #else
26137  if (s1 == s2) {
26138  return (equals == Py_EQ);
26139  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
26140  const char *ps1, *ps2;
26141  Py_ssize_t length = PyBytes_GET_SIZE(s1);
26142  if (length != PyBytes_GET_SIZE(s2))
26143  return (equals == Py_NE);
26144  ps1 = PyBytes_AS_STRING(s1);
26145  ps2 = PyBytes_AS_STRING(s2);
26146  if (ps1[0] != ps2[0]) {
26147  return (equals == Py_NE);
26148  } else if (length == 1) {
26149  return (equals == Py_EQ);
26150  } else {
26151  int result;
26152 #if CYTHON_USE_UNICODE_INTERNALS
26153  Py_hash_t hash1, hash2;
26154  hash1 = ((PyBytesObject*)s1)->ob_shash;
26155  hash2 = ((PyBytesObject*)s2)->ob_shash;
26156  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
26157  return (equals == Py_NE);
26158  }
26159 #endif
26160  result = memcmp(ps1, ps2, (size_t)length);
26161  return (equals == Py_EQ) ? (result == 0) : (result != 0);
26162  }
26163  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
26164  return (equals == Py_NE);
26165  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
26166  return (equals == Py_NE);
26167  } else {
26168  int result;
26169  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
26170  if (!py_result)
26171  return -1;
26172  result = __Pyx_PyObject_IsTrue(py_result);
26173  Py_DECREF(py_result);
26174  return result;
26175  }
26176 #endif
26177 }
26178 
26179 /* UnicodeEquals */
26180 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
26181 #if CYTHON_COMPILING_IN_PYPY
26182  return PyObject_RichCompareBool(s1, s2, equals);
26183 #else
26184 #if PY_MAJOR_VERSION < 3
26185  PyObject* owned_ref = NULL;
26186 #endif
26187  int s1_is_unicode, s2_is_unicode;
26188  if (s1 == s2) {
26189  goto return_eq;
26190  }
26191  s1_is_unicode = PyUnicode_CheckExact(s1);
26192  s2_is_unicode = PyUnicode_CheckExact(s2);
26193 #if PY_MAJOR_VERSION < 3
26194  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
26195  owned_ref = PyUnicode_FromObject(s2);
26196  if (unlikely(!owned_ref))
26197  return -1;
26198  s2 = owned_ref;
26199  s2_is_unicode = 1;
26200  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
26201  owned_ref = PyUnicode_FromObject(s1);
26202  if (unlikely(!owned_ref))
26203  return -1;
26204  s1 = owned_ref;
26205  s1_is_unicode = 1;
26206  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
26207  return __Pyx_PyBytes_Equals(s1, s2, equals);
26208  }
26209 #endif
26210  if (s1_is_unicode & s2_is_unicode) {
26211  Py_ssize_t length;
26212  int kind;
26213  void *data1, *data2;
26214  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
26215  return -1;
26216  length = __Pyx_PyUnicode_GET_LENGTH(s1);
26217  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
26218  goto return_ne;
26219  }
26220 #if CYTHON_USE_UNICODE_INTERNALS
26221  {
26222  Py_hash_t hash1, hash2;
26223  #if CYTHON_PEP393_ENABLED
26224  hash1 = ((PyASCIIObject*)s1)->hash;
26225  hash2 = ((PyASCIIObject*)s2)->hash;
26226  #else
26227  hash1 = ((PyUnicodeObject*)s1)->hash;
26228  hash2 = ((PyUnicodeObject*)s2)->hash;
26229  #endif
26230  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
26231  goto return_ne;
26232  }
26233  }
26234 #endif
26235  kind = __Pyx_PyUnicode_KIND(s1);
26236  if (kind != __Pyx_PyUnicode_KIND(s2)) {
26237  goto return_ne;
26238  }
26239  data1 = __Pyx_PyUnicode_DATA(s1);
26240  data2 = __Pyx_PyUnicode_DATA(s2);
26241  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
26242  goto return_ne;
26243  } else if (length == 1) {
26244  goto return_eq;
26245  } else {
26246  int result = memcmp(data1, data2, (size_t)(length * kind));
26247  #if PY_MAJOR_VERSION < 3
26248  Py_XDECREF(owned_ref);
26249  #endif
26250  return (equals == Py_EQ) ? (result == 0) : (result != 0);
26251  }
26252  } else if ((s1 == Py_None) & s2_is_unicode) {
26253  goto return_ne;
26254  } else if ((s2 == Py_None) & s1_is_unicode) {
26255  goto return_ne;
26256  } else {
26257  int result;
26258  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
26259  #if PY_MAJOR_VERSION < 3
26260  Py_XDECREF(owned_ref);
26261  #endif
26262  if (!py_result)
26263  return -1;
26264  result = __Pyx_PyObject_IsTrue(py_result);
26265  Py_DECREF(py_result);
26266  return result;
26267  }
26268 return_eq:
26269  #if PY_MAJOR_VERSION < 3
26270  Py_XDECREF(owned_ref);
26271  #endif
26272  return (equals == Py_EQ);
26273 return_ne:
26274  #if PY_MAJOR_VERSION < 3
26275  Py_XDECREF(owned_ref);
26276  #endif
26277  return (equals == Py_NE);
26278 #endif
26279 }
26280 
26281 /* None */
26282 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
26283  Py_ssize_t q = a / b;
26284  Py_ssize_t r = a - q*b;
26285  q -= ((r != 0) & ((r ^ b) < 0));
26286  return q;
26287 }
26288 
26289 /* decode_c_string */
26290 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
26291  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
26292  const char* encoding, const char* errors,
26293  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
26294  Py_ssize_t length;
26295  if (unlikely((start < 0) | (stop < 0))) {
26296  size_t slen = strlen(cstring);
26297  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
26298  PyErr_SetString(PyExc_OverflowError,
26299  "c-string too long to convert to Python");
26300  return NULL;
26301  }
26302  length = (Py_ssize_t) slen;
26303  if (start < 0) {
26304  start += length;
26305  if (start < 0)
26306  start = 0;
26307  }
26308  if (stop < 0)
26309  stop += length;
26310  }
26311  if (unlikely(stop <= start))
26312  return __Pyx_NewRef(__pyx_empty_unicode);
26313  length = stop - start;
26314  cstring += start;
26315  if (decode_func) {
26316  return decode_func(cstring, length, errors);
26317  } else {
26318  return PyUnicode_Decode(cstring, length, encoding, errors);
26319  }
26320 }
26321 
26322 /* RaiseTooManyValuesToUnpack */
26323 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
26324  PyErr_Format(PyExc_ValueError,
26325  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
26326 }
26327 
26328 /* RaiseNeedMoreValuesToUnpack */
26329 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
26330  PyErr_Format(PyExc_ValueError,
26331  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
26332  index, (index == 1) ? "" : "s");
26333 }
26334 
26335 /* RaiseNoneIterError */
26336 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
26337  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
26338 }
26339 
26340 /* ExtTypeTest */
26341 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
26342  if (unlikely(!type)) {
26343  PyErr_SetString(PyExc_SystemError, "Missing type object");
26344  return 0;
26345  }
26346  if (likely(__Pyx_TypeCheck(obj, type)))
26347  return 1;
26348  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
26349  Py_TYPE(obj)->tp_name, type->tp_name);
26350  return 0;
26351 }
26352 
26353 /* SwapException */
26354 #if CYTHON_FAST_THREAD_STATE
26355 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26356  PyObject *tmp_type, *tmp_value, *tmp_tb;
26357  #if CYTHON_USE_EXC_INFO_STACK
26358  _PyErr_StackItem *exc_info = tstate->exc_info;
26359  tmp_type = exc_info->exc_type;
26360  tmp_value = exc_info->exc_value;
26361  tmp_tb = exc_info->exc_traceback;
26362  exc_info->exc_type = *type;
26363  exc_info->exc_value = *value;
26364  exc_info->exc_traceback = *tb;
26365  #else
26366  tmp_type = tstate->exc_type;
26367  tmp_value = tstate->exc_value;
26368  tmp_tb = tstate->exc_traceback;
26369  tstate->exc_type = *type;
26370  tstate->exc_value = *value;
26371  tstate->exc_traceback = *tb;
26372  #endif
26373  *type = tmp_type;
26374  *value = tmp_value;
26375  *tb = tmp_tb;
26376 }
26377 #else
26378 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
26379  PyObject *tmp_type, *tmp_value, *tmp_tb;
26380  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
26381  PyErr_SetExcInfo(*type, *value, *tb);
26382  *type = tmp_type;
26383  *value = tmp_value;
26384  *tb = tmp_tb;
26385 }
26386 #endif
26387 
26388 /* FastTypeChecks */
26389 #if CYTHON_COMPILING_IN_CPYTHON
26390 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
26391  while (a) {
26392  a = a->tp_base;
26393  if (a == b)
26394  return 1;
26395  }
26396  return b == &PyBaseObject_Type;
26397 }
26398 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
26399  PyObject *mro;
26400  if (a == b) return 1;
26401  mro = a->tp_mro;
26402  if (likely(mro)) {
26403  Py_ssize_t i, n;
26404  n = PyTuple_GET_SIZE(mro);
26405  for (i = 0; i < n; i++) {
26406  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
26407  return 1;
26408  }
26409  return 0;
26410  }
26411  return __Pyx_InBases(a, b);
26412 }
26413 #if PY_MAJOR_VERSION == 2
26414 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
26415  PyObject *exception, *value, *tb;
26416  int res;
26417  __Pyx_PyThreadState_declare
26418  __Pyx_PyThreadState_assign
26419  __Pyx_ErrFetch(&exception, &value, &tb);
26420  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
26421  if (unlikely(res == -1)) {
26422  PyErr_WriteUnraisable(err);
26423  res = 0;
26424  }
26425  if (!res) {
26426  res = PyObject_IsSubclass(err, exc_type2);
26427  if (unlikely(res == -1)) {
26428  PyErr_WriteUnraisable(err);
26429  res = 0;
26430  }
26431  }
26432  __Pyx_ErrRestore(exception, value, tb);
26433  return res;
26434 }
26435 #else
26436 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
26437  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
26438  if (!res) {
26439  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
26440  }
26441  return res;
26442 }
26443 #endif
26444 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
26445  Py_ssize_t i, n;
26446  assert(PyExceptionClass_Check(exc_type));
26447  n = PyTuple_GET_SIZE(tuple);
26448 #if PY_MAJOR_VERSION >= 3
26449  for (i=0; i<n; i++) {
26450  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
26451  }
26452 #endif
26453  for (i=0; i<n; i++) {
26454  PyObject *t = PyTuple_GET_ITEM(tuple, i);
26455  #if PY_MAJOR_VERSION < 3
26456  if (likely(exc_type == t)) return 1;
26457  #endif
26458  if (likely(PyExceptionClass_Check(t))) {
26459  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
26460  } else {
26461  }
26462  }
26463  return 0;
26464 }
26465 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
26466  if (likely(err == exc_type)) return 1;
26467  if (likely(PyExceptionClass_Check(err))) {
26468  if (likely(PyExceptionClass_Check(exc_type))) {
26469  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
26470  } else if (likely(PyTuple_Check(exc_type))) {
26471  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
26472  } else {
26473  }
26474  }
26475  return PyErr_GivenExceptionMatches(err, exc_type);
26476 }
26477 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
26478  assert(PyExceptionClass_Check(exc_type1));
26479  assert(PyExceptionClass_Check(exc_type2));
26480  if (likely(err == exc_type1 || err == exc_type2)) return 1;
26481  if (likely(PyExceptionClass_Check(err))) {
26482  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
26483  }
26484  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
26485 }
26486 #endif
26487 
26488 /* PyIntBinop */
26489 #if !CYTHON_COMPILING_IN_PYPY
26490 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
26491  (void)inplace;
26492  (void)zerodivision_check;
26493  #if PY_MAJOR_VERSION < 3
26494  if (likely(PyInt_CheckExact(op1))) {
26495  const long b = intval;
26496  long x;
26497  long a = PyInt_AS_LONG(op1);
26498  x = (long)((unsigned long)a + b);
26499  if (likely((x^a) >= 0 || (x^b) >= 0))
26500  return PyInt_FromLong(x);
26501  return PyLong_Type.tp_as_number->nb_add(op1, op2);
26502  }
26503  #endif
26504  #if CYTHON_USE_PYLONG_INTERNALS
26505  if (likely(PyLong_CheckExact(op1))) {
26506  const long b = intval;
26507  long a, x;
26508 #ifdef HAVE_LONG_LONG
26509  const PY_LONG_LONG llb = intval;
26510  PY_LONG_LONG lla, llx;
26511 #endif
26512  const digit* digits = ((PyLongObject*)op1)->ob_digit;
26513  const Py_ssize_t size = Py_SIZE(op1);
26514  if (likely(__Pyx_sst_abs(size) <= 1)) {
26515  a = likely(size) ? digits[0] : 0;
26516  if (size == -1) a = -a;
26517  } else {
26518  switch (size) {
26519  case -2:
26520  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
26521  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26522  break;
26523 #ifdef HAVE_LONG_LONG
26524  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
26525  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26526  goto long_long;
26527 #endif
26528  }
26529  CYTHON_FALLTHROUGH;
26530  case 2:
26531  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
26532  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26533  break;
26534 #ifdef HAVE_LONG_LONG
26535  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
26536  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26537  goto long_long;
26538 #endif
26539  }
26540  CYTHON_FALLTHROUGH;
26541  case -3:
26542  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
26543  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26544  break;
26545 #ifdef HAVE_LONG_LONG
26546  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
26547  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26548  goto long_long;
26549 #endif
26550  }
26551  CYTHON_FALLTHROUGH;
26552  case 3:
26553  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
26554  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26555  break;
26556 #ifdef HAVE_LONG_LONG
26557  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
26558  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26559  goto long_long;
26560 #endif
26561  }
26562  CYTHON_FALLTHROUGH;
26563  case -4:
26564  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
26565  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26566  break;
26567 #ifdef HAVE_LONG_LONG
26568  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
26569  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26570  goto long_long;
26571 #endif
26572  }
26573  CYTHON_FALLTHROUGH;
26574  case 4:
26575  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
26576  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26577  break;
26578 #ifdef HAVE_LONG_LONG
26579  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
26580  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26581  goto long_long;
26582 #endif
26583  }
26584  CYTHON_FALLTHROUGH;
26585  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
26586  }
26587  }
26588  x = a + b;
26589  return PyLong_FromLong(x);
26590 #ifdef HAVE_LONG_LONG
26591  long_long:
26592  llx = lla + llb;
26593  return PyLong_FromLongLong(llx);
26594 #endif
26595 
26596 
26597  }
26598  #endif
26599  if (PyFloat_CheckExact(op1)) {
26600  const long b = intval;
26601  double a = PyFloat_AS_DOUBLE(op1);
26602  double result;
26603  PyFPE_START_PROTECT("add", return NULL)
26604  result = ((double)a) + (double)b;
26605  PyFPE_END_PROTECT(result)
26606  return PyFloat_FromDouble(result);
26607  }
26608  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
26609 }
26610 #endif
26611 
26612 /* None */
26613 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
26614  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
26615 }
26616 
26617 /* None */
26618 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
26619  long q = a / b;
26620  long r = a - q*b;
26621  q -= ((r != 0) & ((r ^ b) < 0));
26622  return q;
26623 }
26624 
26625 /* PyObject_GenericGetAttrNoDict */
26626 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
26627 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
26628  PyErr_Format(PyExc_AttributeError,
26629 #if PY_MAJOR_VERSION >= 3
26630  "'%.50s' object has no attribute '%U'",
26631  tp->tp_name, attr_name);
26632 #else
26633  "'%.50s' object has no attribute '%.400s'",
26634  tp->tp_name, PyString_AS_STRING(attr_name));
26635 #endif
26636  return NULL;
26637 }
26638 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
26639  PyObject *descr;
26640  PyTypeObject *tp = Py_TYPE(obj);
26641  if (unlikely(!PyString_Check(attr_name))) {
26642  return PyObject_GenericGetAttr(obj, attr_name);
26643  }
26644  assert(!tp->tp_dictoffset);
26645  descr = _PyType_Lookup(tp, attr_name);
26646  if (unlikely(!descr)) {
26647  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
26648  }
26649  Py_INCREF(descr);
26650  #if PY_MAJOR_VERSION < 3
26651  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
26652  #endif
26653  {
26654  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
26655  if (unlikely(f)) {
26656  PyObject *res = f(descr, obj, (PyObject *)tp);
26657  Py_DECREF(descr);
26658  return res;
26659  }
26660  }
26661  return descr;
26662 }
26663 #endif
26664 
26665 /* PyObject_GenericGetAttr */
26666 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
26667 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
26668  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
26669  return PyObject_GenericGetAttr(obj, attr_name);
26670  }
26671  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
26672 }
26673 #endif
26674 
26675 /* PyObjectGetAttrStrNoError */
26676 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
26677  __Pyx_PyThreadState_declare
26678  __Pyx_PyThreadState_assign
26679  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
26680  __Pyx_PyErr_Clear();
26681 }
26682 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
26683  PyObject *result;
26684 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
26685  PyTypeObject* tp = Py_TYPE(obj);
26686  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
26687  return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
26688  }
26689 #endif
26690  result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
26691  if (unlikely(!result)) {
26692  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
26693  }
26694  return result;
26695 }
26696 
26697 /* SetupReduce */
26698 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
26699  int ret;
26700  PyObject *name_attr;
26701  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
26702  if (likely(name_attr)) {
26703  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
26704  } else {
26705  ret = -1;
26706  }
26707  if (unlikely(ret < 0)) {
26708  PyErr_Clear();
26709  ret = 0;
26710  }
26711  Py_XDECREF(name_attr);
26712  return ret;
26713 }
26714 static int __Pyx_setup_reduce(PyObject* type_obj) {
26715  int ret = 0;
26716  PyObject *object_reduce = NULL;
26717  PyObject *object_reduce_ex = NULL;
26718  PyObject *reduce = NULL;
26719  PyObject *reduce_ex = NULL;
26720  PyObject *reduce_cython = NULL;
26721  PyObject *setstate = NULL;
26722  PyObject *setstate_cython = NULL;
26723 #if CYTHON_USE_PYTYPE_LOOKUP
26724  if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
26725 #else
26726  if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
26727 #endif
26728 #if CYTHON_USE_PYTYPE_LOOKUP
26729  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
26730 #else
26731  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
26732 #endif
26733  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
26734  if (reduce_ex == object_reduce_ex) {
26735 #if CYTHON_USE_PYTYPE_LOOKUP
26736  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
26737 #else
26738  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
26739 #endif
26740  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
26741  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
26742  reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
26743  if (likely(reduce_cython)) {
26744  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
26745  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
26746  } else if (reduce == object_reduce || PyErr_Occurred()) {
26747  goto __PYX_BAD;
26748  }
26749  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
26750  if (!setstate) PyErr_Clear();
26751  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
26752  setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
26753  if (likely(setstate_cython)) {
26754  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
26755  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
26756  } else if (!setstate || PyErr_Occurred()) {
26757  goto __PYX_BAD;
26758  }
26759  }
26760  PyType_Modified((PyTypeObject*)type_obj);
26761  }
26762  }
26763  goto __PYX_GOOD;
26764 __PYX_BAD:
26765  if (!PyErr_Occurred())
26766  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
26767  ret = -1;
26768 __PYX_GOOD:
26769 #if !CYTHON_USE_PYTYPE_LOOKUP
26770  Py_XDECREF(object_reduce);
26771  Py_XDECREF(object_reduce_ex);
26772 #endif
26773  Py_XDECREF(reduce);
26774  Py_XDECREF(reduce_ex);
26775  Py_XDECREF(reduce_cython);
26776  Py_XDECREF(setstate);
26777  Py_XDECREF(setstate_cython);
26778  return ret;
26779 }
26780 
26781 /* SetVTable */
26782 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
26783 #if PY_VERSION_HEX >= 0x02070000
26784  PyObject *ob = PyCapsule_New(vtable, 0, 0);
26785 #else
26786  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
26787 #endif
26788  if (!ob)
26789  goto bad;
26790  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
26791  goto bad;
26792  Py_DECREF(ob);
26793  return 0;
26794 bad:
26795  Py_XDECREF(ob);
26796  return -1;
26797 }
26798 
26799 /* TypeImport */
26800 #ifndef __PYX_HAVE_RT_ImportType
26801 #define __PYX_HAVE_RT_ImportType
26802 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
26803  size_t size, enum __Pyx_ImportType_CheckSize check_size)
26804 {
26805  PyObject *result = 0;
26806  char warning[200];
26807  Py_ssize_t basicsize;
26808 #ifdef Py_LIMITED_API
26809  PyObject *py_basicsize;
26810 #endif
26811  result = PyObject_GetAttrString(module, class_name);
26812  if (!result)
26813  goto bad;
26814  if (!PyType_Check(result)) {
26815  PyErr_Format(PyExc_TypeError,
26816  "%.200s.%.200s is not a type object",
26817  module_name, class_name);
26818  goto bad;
26819  }
26820 #ifndef Py_LIMITED_API
26821  basicsize = ((PyTypeObject *)result)->tp_basicsize;
26822 #else
26823  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
26824  if (!py_basicsize)
26825  goto bad;
26826  basicsize = PyLong_AsSsize_t(py_basicsize);
26827  Py_DECREF(py_basicsize);
26828  py_basicsize = 0;
26829  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
26830  goto bad;
26831 #endif
26832  if ((size_t)basicsize < size) {
26833  PyErr_Format(PyExc_ValueError,
26834  "%.200s.%.200s size changed, may indicate binary incompatibility. "
26835  "Expected %zd from C header, got %zd from PyObject",
26836  module_name, class_name, size, basicsize);
26837  goto bad;
26838  }
26839  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
26840  PyErr_Format(PyExc_ValueError,
26841  "%.200s.%.200s size changed, may indicate binary incompatibility. "
26842  "Expected %zd from C header, got %zd from PyObject",
26843  module_name, class_name, size, basicsize);
26844  goto bad;
26845  }
26846  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
26847  PyOS_snprintf(warning, sizeof(warning),
26848  "%s.%s size changed, may indicate binary incompatibility. "
26849  "Expected %zd from C header, got %zd from PyObject",
26850  module_name, class_name, size, basicsize);
26851  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
26852  }
26853  return (PyTypeObject *)result;
26854 bad:
26855  Py_XDECREF(result);
26856  return NULL;
26857 }
26858 #endif
26859 
26860 /* CLineInTraceback */
26861 #ifndef CYTHON_CLINE_IN_TRACEBACK
26862 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
26863  PyObject *use_cline;
26864  PyObject *ptype, *pvalue, *ptraceback;
26865 #if CYTHON_COMPILING_IN_CPYTHON
26866  PyObject **cython_runtime_dict;
26867 #endif
26868  if (unlikely(!__pyx_cython_runtime)) {
26869  return c_line;
26870  }
26871  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26872 #if CYTHON_COMPILING_IN_CPYTHON
26873  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
26874  if (likely(cython_runtime_dict)) {
26875  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
26876  use_cline, *cython_runtime_dict,
26877  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
26878  } else
26879 #endif
26880  {
26881  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
26882  if (use_cline_obj) {
26883  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
26884  Py_DECREF(use_cline_obj);
26885  } else {
26886  PyErr_Clear();
26887  use_cline = NULL;
26888  }
26889  }
26890  if (!use_cline) {
26891  c_line = 0;
26892  PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
26893  }
26894  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
26895  c_line = 0;
26896  }
26897  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26898  return c_line;
26899 }
26900 #endif
26901 
26902 /* CodeObjectCache */
26903 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
26904  int start = 0, mid = 0, end = count - 1;
26905  if (end >= 0 && code_line > entries[end].code_line) {
26906  return count;
26907  }
26908  while (start < end) {
26909  mid = start + (end - start) / 2;
26910  if (code_line < entries[mid].code_line) {
26911  end = mid;
26912  } else if (code_line > entries[mid].code_line) {
26913  start = mid + 1;
26914  } else {
26915  return mid;
26916  }
26917  }
26918  if (code_line <= entries[mid].code_line) {
26919  return mid;
26920  } else {
26921  return mid + 1;
26922  }
26923 }
26924 static PyCodeObject *__pyx_find_code_object(int code_line) {
26925  PyCodeObject* code_object;
26926  int pos;
26927  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
26928  return NULL;
26929  }
26930  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26931  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
26932  return NULL;
26933  }
26934  code_object = __pyx_code_cache.entries[pos].code_object;
26935  Py_INCREF(code_object);
26936  return code_object;
26937 }
26938 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
26939  int pos, i;
26940  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
26941  if (unlikely(!code_line)) {
26942  return;
26943  }
26944  if (unlikely(!entries)) {
26945  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
26946  if (likely(entries)) {
26947  __pyx_code_cache.entries = entries;
26948  __pyx_code_cache.max_count = 64;
26949  __pyx_code_cache.count = 1;
26950  entries[0].code_line = code_line;
26951  entries[0].code_object = code_object;
26952  Py_INCREF(code_object);
26953  }
26954  return;
26955  }
26956  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26957  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
26958  PyCodeObject* tmp = entries[pos].code_object;
26959  entries[pos].code_object = code_object;
26960  Py_DECREF(tmp);
26961  return;
26962  }
26963  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
26964  int new_max = __pyx_code_cache.max_count + 64;
26965  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
26966  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
26967  if (unlikely(!entries)) {
26968  return;
26969  }
26970  __pyx_code_cache.entries = entries;
26971  __pyx_code_cache.max_count = new_max;
26972  }
26973  for (i=__pyx_code_cache.count; i>pos; i--) {
26974  entries[i] = entries[i-1];
26975  }
26976  entries[pos].code_line = code_line;
26977  entries[pos].code_object = code_object;
26978  __pyx_code_cache.count++;
26979  Py_INCREF(code_object);
26980 }
26981 
26982 /* AddTraceback */
26983 #include "compile.h"
26984 #include "frameobject.h"
26985 #include "traceback.h"
26986 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26987  const char *funcname, int c_line,
26988  int py_line, const char *filename) {
26989  PyCodeObject *py_code = 0;
26990  PyObject *py_srcfile = 0;
26991  PyObject *py_funcname = 0;
26992  #if PY_MAJOR_VERSION < 3
26993  py_srcfile = PyString_FromString(filename);
26994  #else
26995  py_srcfile = PyUnicode_FromString(filename);
26996  #endif
26997  if (!py_srcfile) goto bad;
26998  if (c_line) {
26999  #if PY_MAJOR_VERSION < 3
27000  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27001  #else
27002  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27003  #endif
27004  }
27005  else {
27006  #if PY_MAJOR_VERSION < 3
27007  py_funcname = PyString_FromString(funcname);
27008  #else
27009  py_funcname = PyUnicode_FromString(funcname);
27010  #endif
27011  }
27012  if (!py_funcname) goto bad;
27013  py_code = __Pyx_PyCode_New(
27014  0,
27015  0,
27016  0,
27017  0,
27018  0,
27019  __pyx_empty_bytes, /*PyObject *code,*/
27020  __pyx_empty_tuple, /*PyObject *consts,*/
27021  __pyx_empty_tuple, /*PyObject *names,*/
27022  __pyx_empty_tuple, /*PyObject *varnames,*/
27023  __pyx_empty_tuple, /*PyObject *freevars,*/
27024  __pyx_empty_tuple, /*PyObject *cellvars,*/
27025  py_srcfile, /*PyObject *filename,*/
27026  py_funcname, /*PyObject *name,*/
27027  py_line,
27028  __pyx_empty_bytes /*PyObject *lnotab*/
27029  );
27030  Py_DECREF(py_srcfile);
27031  Py_DECREF(py_funcname);
27032  return py_code;
27033 bad:
27034  Py_XDECREF(py_srcfile);
27035  Py_XDECREF(py_funcname);
27036  return NULL;
27037 }
27038 static void __Pyx_AddTraceback(const char *funcname, int c_line,
27039  int py_line, const char *filename) {
27040  PyCodeObject *py_code = 0;
27041  PyFrameObject *py_frame = 0;
27042  PyThreadState *tstate = __Pyx_PyThreadState_Current;
27043  if (c_line) {
27044  c_line = __Pyx_CLineForTraceback(tstate, c_line);
27045  }
27046  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
27047  if (!py_code) {
27048  py_code = __Pyx_CreateCodeObjectForTraceback(
27049  funcname, c_line, py_line, filename);
27050  if (!py_code) goto bad;
27051  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
27052  }
27053  py_frame = PyFrame_New(
27054  tstate, /*PyThreadState *tstate,*/
27055  py_code, /*PyCodeObject *code,*/
27056  __pyx_d, /*PyObject *globals,*/
27057  0 /*PyObject *locals*/
27058  );
27059  if (!py_frame) goto bad;
27060  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
27061  PyTraceBack_Here(py_frame);
27062 bad:
27063  Py_XDECREF(py_code);
27064  Py_XDECREF(py_frame);
27065 }
27066 
27067 #if PY_MAJOR_VERSION < 3
27068 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
27069  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
27070  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
27071  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
27072  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
27073  return -1;
27074 }
27075 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
27076  PyObject *obj = view->obj;
27077  if (!obj) return;
27078  if (PyObject_CheckBuffer(obj)) {
27079  PyBuffer_Release(view);
27080  return;
27081  }
27082  if ((0)) {}
27083  view->obj = NULL;
27084  Py_DECREF(obj);
27085 }
27086 #endif
27087 
27088 
27089 /* MemviewSliceIsContig */
27090 static int
27091 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
27092 {
27093  int i, index, step, start;
27094  Py_ssize_t itemsize = mvs.memview->view.itemsize;
27095  if (order == 'F') {
27096  step = 1;
27097  start = 0;
27098  } else {
27099  step = -1;
27100  start = ndim - 1;
27101  }
27102  for (i = 0; i < ndim; i++) {
27103  index = start + step * i;
27104  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
27105  return 0;
27106  itemsize *= mvs.shape[index];
27107  }
27108  return 1;
27109 }
27110 
27111 /* OverlappingSlices */
27112 static void
27113 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
27114  void **out_start, void **out_end,
27115  int ndim, size_t itemsize)
27116 {
27117  char *start, *end;
27118  int i;
27119  start = end = slice->data;
27120  for (i = 0; i < ndim; i++) {
27121  Py_ssize_t stride = slice->strides[i];
27122  Py_ssize_t extent = slice->shape[i];
27123  if (extent == 0) {
27124  *out_start = *out_end = start;
27125  return;
27126  } else {
27127  if (stride > 0)
27128  end += stride * (extent - 1);
27129  else
27130  start += stride * (extent - 1);
27131  }
27132  }
27133  *out_start = start;
27134  *out_end = end + itemsize;
27135 }
27136 static int
27137 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
27138  __Pyx_memviewslice *slice2,
27139  int ndim, size_t itemsize)
27140 {
27141  void *start1, *end1, *start2, *end2;
27142  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
27143  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
27144  return (start1 < end2) && (start2 < end1);
27145 }
27146 
27147 /* Capsule */
27148 static CYTHON_INLINE PyObject *
27149 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
27150 {
27151  PyObject *cobj;
27152 #if PY_VERSION_HEX >= 0x02070000
27153  cobj = PyCapsule_New(p, sig, NULL);
27154 #else
27155  cobj = PyCObject_FromVoidPtr(p, NULL);
27156 #endif
27157  return cobj;
27158 }
27159 
27160 /* MemviewDtypeToObject */
27161 static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp) {
27162  return (PyObject *) PyFloat_FromDouble(*(double *) itemp);
27163 }
27164 static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
27165  double value = __pyx_PyFloat_AsDouble(obj);
27166  if ((value == (double)-1) && PyErr_Occurred())
27167  return 0;
27168  *(double *) itemp = value;
27169  return 1;
27170 }
27171 
27172 /* IsLittleEndian */
27173 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
27174 {
27175  union {
27176  uint32_t u32;
27177  uint8_t u8[4];
27178  } S;
27179  S.u32 = 0x01020304;
27180  return S.u8[0] == 4;
27181 }
27182 
27183 /* BufferFormatCheck */
27184 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
27185  __Pyx_BufFmt_StackElem* stack,
27186  __Pyx_TypeInfo* type) {
27187  stack[0].field = &ctx->root;
27188  stack[0].parent_offset = 0;
27189  ctx->root.type = type;
27190  ctx->root.name = "buffer dtype";
27191  ctx->root.offset = 0;
27192  ctx->head = stack;
27193  ctx->head->field = &ctx->root;
27194  ctx->fmt_offset = 0;
27195  ctx->head->parent_offset = 0;
27196  ctx->new_packmode = '@';
27197  ctx->enc_packmode = '@';
27198  ctx->new_count = 1;
27199  ctx->enc_count = 0;
27200  ctx->enc_type = 0;
27201  ctx->is_complex = 0;
27202  ctx->is_valid_array = 0;
27203  ctx->struct_alignment = 0;
27204  while (type->typegroup == 'S') {
27205  ++ctx->head;
27206  ctx->head->field = type->fields;
27207  ctx->head->parent_offset = 0;
27208  type = type->fields->type;
27209  }
27210 }
27211 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
27212  int count;
27213  const char* t = *ts;
27214  if (*t < '0' || *t > '9') {
27215  return -1;
27216  } else {
27217  count = *t++ - '0';
27218  while (*t >= '0' && *t <= '9') {
27219  count *= 10;
27220  count += *t++ - '0';
27221  }
27222  }
27223  *ts = t;
27224  return count;
27225 }
27226 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
27227  int number = __Pyx_BufFmt_ParseNumber(ts);
27228  if (number == -1)
27229  PyErr_Format(PyExc_ValueError,\
27230  "Does not understand character buffer dtype format string ('%c')", **ts);
27231  return number;
27232 }
27233 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
27234  PyErr_Format(PyExc_ValueError,
27235  "Unexpected format string character: '%c'", ch);
27236 }
27237 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
27238  switch (ch) {
27239  case '?': return "'bool'";
27240  case 'c': return "'char'";
27241  case 'b': return "'signed char'";
27242  case 'B': return "'unsigned char'";
27243  case 'h': return "'short'";
27244  case 'H': return "'unsigned short'";
27245  case 'i': return "'int'";
27246  case 'I': return "'unsigned int'";
27247  case 'l': return "'long'";
27248  case 'L': return "'unsigned long'";
27249  case 'q': return "'long long'";
27250  case 'Q': return "'unsigned long long'";
27251  case 'f': return (is_complex ? "'complex float'" : "'float'");
27252  case 'd': return (is_complex ? "'complex double'" : "'double'");
27253  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
27254  case 'T': return "a struct";
27255  case 'O': return "Python object";
27256  case 'P': return "a pointer";
27257  case 's': case 'p': return "a string";
27258  case 0: return "end";
27259  default: return "unparseable format string";
27260  }
27261 }
27262 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
27263  switch (ch) {
27264  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
27265  case 'h': case 'H': return 2;
27266  case 'i': case 'I': case 'l': case 'L': return 4;
27267  case 'q': case 'Q': return 8;
27268  case 'f': return (is_complex ? 8 : 4);
27269  case 'd': return (is_complex ? 16 : 8);
27270  case 'g': {
27271  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
27272  return 0;
27273  }
27274  case 'O': case 'P': return sizeof(void*);
27275  default:
27276  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27277  return 0;
27278  }
27279 }
27280 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
27281  switch (ch) {
27282  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
27283  case 'h': case 'H': return sizeof(short);
27284  case 'i': case 'I': return sizeof(int);
27285  case 'l': case 'L': return sizeof(long);
27286  #ifdef HAVE_LONG_LONG
27287  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
27288  #endif
27289  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
27290  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
27291  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
27292  case 'O': case 'P': return sizeof(void*);
27293  default: {
27294  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27295  return 0;
27296  }
27297  }
27298 }
27299 typedef struct { char c; short x; } __Pyx_st_short;
27300 typedef struct { char c; int x; } __Pyx_st_int;
27301 typedef struct { char c; long x; } __Pyx_st_long;
27302 typedef struct { char c; float x; } __Pyx_st_float;
27303 typedef struct { char c; double x; } __Pyx_st_double;
27304 typedef struct { char c; long double x; } __Pyx_st_longdouble;
27305 typedef struct { char c; void *x; } __Pyx_st_void_p;
27306 #ifdef HAVE_LONG_LONG
27307 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
27308 #endif
27309 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
27310  switch (ch) {
27311  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
27312  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
27313  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
27314  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
27315 #ifdef HAVE_LONG_LONG
27316  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
27317 #endif
27318  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
27319  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
27320  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
27321  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
27322  default:
27323  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27324  return 0;
27325  }
27326 }
27327 /* These are for computing the padding at the end of the struct to align
27328  on the first member of the struct. This will probably the same as above,
27329  but we don't have any guarantees.
27330  */
27331 typedef struct { short x; char c; } __Pyx_pad_short;
27332 typedef struct { int x; char c; } __Pyx_pad_int;
27333 typedef struct { long x; char c; } __Pyx_pad_long;
27334 typedef struct { float x; char c; } __Pyx_pad_float;
27335 typedef struct { double x; char c; } __Pyx_pad_double;
27336 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
27337 typedef struct { void *x; char c; } __Pyx_pad_void_p;
27338 #ifdef HAVE_LONG_LONG
27339 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
27340 #endif
27341 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
27342  switch (ch) {
27343  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
27344  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
27345  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
27346  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
27347 #ifdef HAVE_LONG_LONG
27348  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
27349 #endif
27350  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
27351  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
27352  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
27353  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
27354  default:
27355  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27356  return 0;
27357  }
27358 }
27359 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
27360  switch (ch) {
27361  case 'c':
27362  return 'H';
27363  case 'b': case 'h': case 'i':
27364  case 'l': case 'q': case 's': case 'p':
27365  return 'I';
27366  case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
27367  return 'U';
27368  case 'f': case 'd': case 'g':
27369  return (is_complex ? 'C' : 'R');
27370  case 'O':
27371  return 'O';
27372  case 'P':
27373  return 'P';
27374  default: {
27375  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27376  return 0;
27377  }
27378  }
27379 }
27380 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
27381  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
27382  const char* expected;
27383  const char* quote;
27384  if (ctx->head == NULL) {
27385  expected = "end";
27386  quote = "";
27387  } else {
27388  expected = ctx->head->field->type->name;
27389  quote = "'";
27390  }
27391  PyErr_Format(PyExc_ValueError,
27392  "Buffer dtype mismatch, expected %s%s%s but got %s",
27393  quote, expected, quote,
27394  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
27395  } else {
27396  __Pyx_StructField* field = ctx->head->field;
27397  __Pyx_StructField* parent = (ctx->head - 1)->field;
27398  PyErr_Format(PyExc_ValueError,
27399  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
27400  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
27401  parent->type->name, field->name);
27402  }
27403 }
27404 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
27405  char group;
27406  size_t size, offset, arraysize = 1;
27407  if (ctx->enc_type == 0) return 0;
27408  if (ctx->head->field->type->arraysize[0]) {
27409  int i, ndim = 0;
27410  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
27411  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
27412  ndim = 1;
27413  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
27414  PyErr_Format(PyExc_ValueError,
27415  "Expected a dimension of size %zu, got %zu",
27416  ctx->head->field->type->arraysize[0], ctx->enc_count);
27417  return -1;
27418  }
27419  }
27420  if (!ctx->is_valid_array) {
27421  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
27422  ctx->head->field->type->ndim, ndim);
27423  return -1;
27424  }
27425  for (i = 0; i < ctx->head->field->type->ndim; i++) {
27426  arraysize *= ctx->head->field->type->arraysize[i];
27427  }
27428  ctx->is_valid_array = 0;
27429  ctx->enc_count = 1;
27430  }
27431  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
27432  do {
27433  __Pyx_StructField* field = ctx->head->field;
27434  __Pyx_TypeInfo* type = field->type;
27435  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
27436  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
27437  } else {
27438  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
27439  }
27440  if (ctx->enc_packmode == '@') {
27441  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
27442  size_t align_mod_offset;
27443  if (align_at == 0) return -1;
27444  align_mod_offset = ctx->fmt_offset % align_at;
27445  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
27446  if (ctx->struct_alignment == 0)
27447  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
27448  ctx->is_complex);
27449  }
27450  if (type->size != size || type->typegroup != group) {
27451  if (type->typegroup == 'C' && type->fields != NULL) {
27452  size_t parent_offset = ctx->head->parent_offset + field->offset;
27453  ++ctx->head;
27454  ctx->head->field = type->fields;
27455  ctx->head->parent_offset = parent_offset;
27456  continue;
27457  }
27458  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
27459  } else {
27460  __Pyx_BufFmt_RaiseExpected(ctx);
27461  return -1;
27462  }
27463  }
27464  offset = ctx->head->parent_offset + field->offset;
27465  if (ctx->fmt_offset != offset) {
27466  PyErr_Format(PyExc_ValueError,
27467  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
27468  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
27469  return -1;
27470  }
27471  ctx->fmt_offset += size;
27472  if (arraysize)
27473  ctx->fmt_offset += (arraysize - 1) * size;
27474  --ctx->enc_count;
27475  while (1) {
27476  if (field == &ctx->root) {
27477  ctx->head = NULL;
27478  if (ctx->enc_count != 0) {
27479  __Pyx_BufFmt_RaiseExpected(ctx);
27480  return -1;
27481  }
27482  break;
27483  }
27484  ctx->head->field = ++field;
27485  if (field->type == NULL) {
27486  --ctx->head;
27487  field = ctx->head->field;
27488  continue;
27489  } else if (field->type->typegroup == 'S') {
27490  size_t parent_offset = ctx->head->parent_offset + field->offset;
27491  if (field->type->fields->type == NULL) continue;
27492  field = field->type->fields;
27493  ++ctx->head;
27494  ctx->head->field = field;
27495  ctx->head->parent_offset = parent_offset;
27496  break;
27497  } else {
27498  break;
27499  }
27500  }
27501  } while (ctx->enc_count);
27502  ctx->enc_type = 0;
27503  ctx->is_complex = 0;
27504  return 0;
27505 }
27506 static PyObject *
27507 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
27508 {
27509  const char *ts = *tsp;
27510  int i = 0, number, ndim;
27511  ++ts;
27512  if (ctx->new_count != 1) {
27513  PyErr_SetString(PyExc_ValueError,
27514  "Cannot handle repeated arrays in format string");
27515  return NULL;
27516  }
27517  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27518  ndim = ctx->head->field->type->ndim;
27519  while (*ts && *ts != ')') {
27520  switch (*ts) {
27521  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
27522  default: break;
27523  }
27524  number = __Pyx_BufFmt_ExpectNumber(&ts);
27525  if (number == -1) return NULL;
27526  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
27527  return PyErr_Format(PyExc_ValueError,
27528  "Expected a dimension of size %zu, got %d",
27529  ctx->head->field->type->arraysize[i], number);
27530  if (*ts != ',' && *ts != ')')
27531  return PyErr_Format(PyExc_ValueError,
27532  "Expected a comma in format string, got '%c'", *ts);
27533  if (*ts == ',') ts++;
27534  i++;
27535  }
27536  if (i != ndim)
27537  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
27538  ctx->head->field->type->ndim, i);
27539  if (!*ts) {
27540  PyErr_SetString(PyExc_ValueError,
27541  "Unexpected end of format string, expected ')'");
27542  return NULL;
27543  }
27544  ctx->is_valid_array = 1;
27545  ctx->new_count = 1;
27546  *tsp = ++ts;
27547  return Py_None;
27548 }
27549 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
27550  int got_Z = 0;
27551  while (1) {
27552  switch(*ts) {
27553  case 0:
27554  if (ctx->enc_type != 0 && ctx->head == NULL) {
27555  __Pyx_BufFmt_RaiseExpected(ctx);
27556  return NULL;
27557  }
27558  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27559  if (ctx->head != NULL) {
27560  __Pyx_BufFmt_RaiseExpected(ctx);
27561  return NULL;
27562  }
27563  return ts;
27564  case ' ':
27565  case '\r':
27566  case '\n':
27567  ++ts;
27568  break;
27569  case '<':
27570  if (!__Pyx_Is_Little_Endian()) {
27571  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
27572  return NULL;
27573  }
27574  ctx->new_packmode = '=';
27575  ++ts;
27576  break;
27577  case '>':
27578  case '!':
27579  if (__Pyx_Is_Little_Endian()) {
27580  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
27581  return NULL;
27582  }
27583  ctx->new_packmode = '=';
27584  ++ts;
27585  break;
27586  case '=':
27587  case '@':
27588  case '^':
27589  ctx->new_packmode = *ts++;
27590  break;
27591  case 'T':
27592  {
27593  const char* ts_after_sub;
27594  size_t i, struct_count = ctx->new_count;
27595  size_t struct_alignment = ctx->struct_alignment;
27596  ctx->new_count = 1;
27597  ++ts;
27598  if (*ts != '{') {
27599  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
27600  return NULL;
27601  }
27602  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27603  ctx->enc_type = 0;
27604  ctx->enc_count = 0;
27605  ctx->struct_alignment = 0;
27606  ++ts;
27607  ts_after_sub = ts;
27608  for (i = 0; i != struct_count; ++i) {
27609  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
27610  if (!ts_after_sub) return NULL;
27611  }
27612  ts = ts_after_sub;
27613  if (struct_alignment) ctx->struct_alignment = struct_alignment;
27614  }
27615  break;
27616  case '}':
27617  {
27618  size_t alignment = ctx->struct_alignment;
27619  ++ts;
27620  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27621  ctx->enc_type = 0;
27622  if (alignment && ctx->fmt_offset % alignment) {
27623  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
27624  }
27625  }
27626  return ts;
27627  case 'x':
27628  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27629  ctx->fmt_offset += ctx->new_count;
27630  ctx->new_count = 1;
27631  ctx->enc_count = 0;
27632  ctx->enc_type = 0;
27633  ctx->enc_packmode = ctx->new_packmode;
27634  ++ts;
27635  break;
27636  case 'Z':
27637  got_Z = 1;
27638  ++ts;
27639  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
27640  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
27641  return NULL;
27642  }
27643  CYTHON_FALLTHROUGH;
27644  case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
27645  case 'l': case 'L': case 'q': case 'Q':
27646  case 'f': case 'd': case 'g':
27647  case 'O': case 'p':
27648  if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
27649  (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
27650  ctx->enc_count += ctx->new_count;
27651  ctx->new_count = 1;
27652  got_Z = 0;
27653  ++ts;
27654  break;
27655  }
27656  CYTHON_FALLTHROUGH;
27657  case 's':
27658  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27659  ctx->enc_count = ctx->new_count;
27660  ctx->enc_packmode = ctx->new_packmode;
27661  ctx->enc_type = *ts;
27662  ctx->is_complex = got_Z;
27663  ++ts;
27664  ctx->new_count = 1;
27665  got_Z = 0;
27666  break;
27667  case ':':
27668  ++ts;
27669  while(*ts != ':') ++ts;
27670  ++ts;
27671  break;
27672  case '(':
27673  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
27674  break;
27675  default:
27676  {
27677  int number = __Pyx_BufFmt_ExpectNumber(&ts);
27678  if (number == -1) return NULL;
27679  ctx->new_count = (size_t)number;
27680  }
27681  }
27682  }
27683 }
27684 
27685 /* TypeInfoCompare */
27686  static int
27687 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
27688 {
27689  int i;
27690  if (!a || !b)
27691  return 0;
27692  if (a == b)
27693  return 1;
27694  if (a->size != b->size || a->typegroup != b->typegroup ||
27695  a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
27696  if (a->typegroup == 'H' || b->typegroup == 'H') {
27697  return a->size == b->size;
27698  } else {
27699  return 0;
27700  }
27701  }
27702  if (a->ndim) {
27703  for (i = 0; i < a->ndim; i++)
27704  if (a->arraysize[i] != b->arraysize[i])
27705  return 0;
27706  }
27707  if (a->typegroup == 'S') {
27708  if (a->flags != b->flags)
27709  return 0;
27710  if (a->fields || b->fields) {
27711  if (!(a->fields && b->fields))
27712  return 0;
27713  for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
27714  __Pyx_StructField *field_a = a->fields + i;
27715  __Pyx_StructField *field_b = b->fields + i;
27716  if (field_a->offset != field_b->offset ||
27717  !__pyx_typeinfo_cmp(field_a->type, field_b->type))
27718  return 0;
27719  }
27720  return !a->fields[i].type && !b->fields[i].type;
27721  }
27722  }
27723  return 1;
27724 }
27725 
27726 /* MemviewSliceValidateAndInit */
27727  static int
27728 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
27729 {
27730  if (buf->shape[dim] <= 1)
27731  return 1;
27732  if (buf->strides) {
27733  if (spec & __Pyx_MEMVIEW_CONTIG) {
27734  if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
27735  if (unlikely(buf->strides[dim] != sizeof(void *))) {
27736  PyErr_Format(PyExc_ValueError,
27737  "Buffer is not indirectly contiguous "
27738  "in dimension %d.", dim);
27739  goto fail;
27740  }
27741  } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
27742  PyErr_SetString(PyExc_ValueError,
27743  "Buffer and memoryview are not contiguous "
27744  "in the same dimension.");
27745  goto fail;
27746  }
27747  }
27748  if (spec & __Pyx_MEMVIEW_FOLLOW) {
27749  Py_ssize_t stride = buf->strides[dim];
27750  if (stride < 0)
27751  stride = -stride;
27752  if (unlikely(stride < buf->itemsize)) {
27753  PyErr_SetString(PyExc_ValueError,
27754  "Buffer and memoryview are not contiguous "
27755  "in the same dimension.");
27756  goto fail;
27757  }
27758  }
27759  } else {
27760  if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
27761  PyErr_Format(PyExc_ValueError,
27762  "C-contiguous buffer is not contiguous in "
27763  "dimension %d", dim);
27764  goto fail;
27765  } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
27766  PyErr_Format(PyExc_ValueError,
27767  "C-contiguous buffer is not indirect in "
27768  "dimension %d", dim);
27769  goto fail;
27770  } else if (unlikely(buf->suboffsets)) {
27771  PyErr_SetString(PyExc_ValueError,
27772  "Buffer exposes suboffsets but no strides");
27773  goto fail;
27774  }
27775  }
27776  return 1;
27777 fail:
27778  return 0;
27779 }
27780 static int
27781 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
27782 {
27783  if (spec & __Pyx_MEMVIEW_DIRECT) {
27784  if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
27785  PyErr_Format(PyExc_ValueError,
27786  "Buffer not compatible with direct access "
27787  "in dimension %d.", dim);
27788  goto fail;
27789  }
27790  }
27791  if (spec & __Pyx_MEMVIEW_PTR) {
27792  if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
27793  PyErr_Format(PyExc_ValueError,
27794  "Buffer is not indirectly accessible "
27795  "in dimension %d.", dim);
27796  goto fail;
27797  }
27798  }
27799  return 1;
27800 fail:
27801  return 0;
27802 }
27803 static int
27804 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
27805 {
27806  int i;
27807  if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
27808  Py_ssize_t stride = 1;
27809  for (i = 0; i < ndim; i++) {
27810  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
27811  PyErr_SetString(PyExc_ValueError,
27812  "Buffer not fortran contiguous.");
27813  goto fail;
27814  }
27815  stride = stride * buf->shape[i];
27816  }
27817  } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
27818  Py_ssize_t stride = 1;
27819  for (i = ndim - 1; i >- 1; i--) {
27820  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
27821  PyErr_SetString(PyExc_ValueError,
27822  "Buffer not C contiguous.");
27823  goto fail;
27824  }
27825  stride = stride * buf->shape[i];
27826  }
27827  }
27828  return 1;
27829 fail:
27830  return 0;
27831 }
27832 static int __Pyx_ValidateAndInit_memviewslice(
27833  int *axes_specs,
27834  int c_or_f_flag,
27835  int buf_flags,
27836  int ndim,
27837  __Pyx_TypeInfo *dtype,
27838  __Pyx_BufFmt_StackElem stack[],
27839  __Pyx_memviewslice *memviewslice,
27840  PyObject *original_obj)
27841 {
27842  struct __pyx_memoryview_obj *memview, *new_memview;
27843  __Pyx_RefNannyDeclarations
27844  Py_buffer *buf;
27845  int i, spec = 0, retval = -1;
27846  __Pyx_BufFmt_Context ctx;
27847  int from_memoryview = __pyx_memoryview_check(original_obj);
27848  __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
27849  if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
27850  original_obj)->typeinfo)) {
27851  memview = (struct __pyx_memoryview_obj *) original_obj;
27852  new_memview = NULL;
27853  } else {
27854  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27855  original_obj, buf_flags, 0, dtype);
27856  new_memview = memview;
27857  if (unlikely(!memview))
27858  goto fail;
27859  }
27860  buf = &memview->view;
27861  if (unlikely(buf->ndim != ndim)) {
27862  PyErr_Format(PyExc_ValueError,
27863  "Buffer has wrong number of dimensions (expected %d, got %d)",
27864  ndim, buf->ndim);
27865  goto fail;
27866  }
27867  if (new_memview) {
27868  __Pyx_BufFmt_Init(&ctx, stack, dtype);
27869  if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
27870  }
27871  if (unlikely((unsigned) buf->itemsize != dtype->size)) {
27872  PyErr_Format(PyExc_ValueError,
27873  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
27874  "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
27875  buf->itemsize,
27876  (buf->itemsize > 1) ? "s" : "",
27877  dtype->name,
27878  dtype->size,
27879  (dtype->size > 1) ? "s" : "");
27880  goto fail;
27881  }
27882  if (buf->len > 0) {
27883  for (i = 0; i < ndim; i++) {
27884  spec = axes_specs[i];
27885  if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
27886  goto fail;
27887  if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
27888  goto fail;
27889  }
27890  if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
27891  goto fail;
27892  }
27893  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
27894  new_memview != NULL) == -1)) {
27895  goto fail;
27896  }
27897  retval = 0;
27898  goto no_fail;
27899 fail:
27900  Py_XDECREF(new_memview);
27901  retval = -1;
27902 no_fail:
27903  __Pyx_RefNannyFinishContext();
27904  return retval;
27905 }
27906 
27907 /* ObjectToMemviewSlice */
27908  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj, int writable_flag) {
27909  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27910  __Pyx_BufFmt_StackElem stack[1];
27911  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27912  int retcode;
27913  if (obj == Py_None) {
27914  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27915  return result;
27916  }
27917  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27918  PyBUF_RECORDS_RO | writable_flag, 1,
27919  &__Pyx_TypeInfo_double, stack,
27920  &result, obj);
27921  if (unlikely(retcode == -1))
27922  goto __pyx_fail;
27923  return result;
27924 __pyx_fail:
27925  result.memview = NULL;
27926  result.data = NULL;
27927  return result;
27928 }
27929 
27930 /* CIntFromPyVerify */
27931  #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
27932  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
27933 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
27934  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
27935 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
27936  {\
27937  func_type value = func_value;\
27938  if (sizeof(target_type) < sizeof(func_type)) {\
27939  if (unlikely(value != (func_type) (target_type) value)) {\
27940  func_type zero = 0;\
27941  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
27942  return (target_type) -1;\
27943  if (is_unsigned && unlikely(value < zero))\
27944  goto raise_neg_overflow;\
27945  else\
27946  goto raise_overflow;\
27947  }\
27948  }\
27949  return (target_type) value;\
27950  }
27951 
27952 /* Declarations */
27953  #if CYTHON_CCOMPLEX
27954  #ifdef __cplusplus
27955  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27956  return ::std::complex< float >(x, y);
27957  }
27958  #else
27959  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27960  return x + y*(__pyx_t_float_complex)_Complex_I;
27961  }
27962  #endif
27963 #else
27964  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27965  __pyx_t_float_complex z;
27966  z.real = x;
27967  z.imag = y;
27968  return z;
27969  }
27970 #endif
27971 
27972 /* Arithmetic */
27973  #if CYTHON_CCOMPLEX
27974 #else
27975  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27976  return (a.real == b.real) && (a.imag == b.imag);
27977  }
27978  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27979  __pyx_t_float_complex z;
27980  z.real = a.real + b.real;
27981  z.imag = a.imag + b.imag;
27982  return z;
27983  }
27984  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27985  __pyx_t_float_complex z;
27986  z.real = a.real - b.real;
27987  z.imag = a.imag - b.imag;
27988  return z;
27989  }
27990  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27991  __pyx_t_float_complex z;
27992  z.real = a.real * b.real - a.imag * b.imag;
27993  z.imag = a.real * b.imag + a.imag * b.real;
27994  return z;
27995  }
27996  #if 1
27997  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27998  if (b.imag == 0) {
27999  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
28000  } else if (fabsf(b.real) >= fabsf(b.imag)) {
28001  if (b.real == 0 && b.imag == 0) {
28002  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
28003  } else {
28004  float r = b.imag / b.real;
28005  float s = (float)(1.0) / (b.real + b.imag * r);
28006  return __pyx_t_float_complex_from_parts(
28007  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
28008  }
28009  } else {
28010  float r = b.real / b.imag;
28011  float s = (float)(1.0) / (b.imag + b.real * r);
28012  return __pyx_t_float_complex_from_parts(
28013  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
28014  }
28015  }
28016  #else
28017  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28018  if (b.imag == 0) {
28019  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
28020  } else {
28021  float denom = b.real * b.real + b.imag * b.imag;
28022  return __pyx_t_float_complex_from_parts(
28023  (a.real * b.real + a.imag * b.imag) / denom,
28024  (a.imag * b.real - a.real * b.imag) / denom);
28025  }
28026  }
28027  #endif
28028  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
28029  __pyx_t_float_complex z;
28030  z.real = -a.real;
28031  z.imag = -a.imag;
28032  return z;
28033  }
28034  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
28035  return (a.real == 0) && (a.imag == 0);
28036  }
28037  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
28038  __pyx_t_float_complex z;
28039  z.real = a.real;
28040  z.imag = -a.imag;
28041  return z;
28042  }
28043  #if 1
28044  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
28045  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
28046  return sqrtf(z.real*z.real + z.imag*z.imag);
28047  #else
28048  return hypotf(z.real, z.imag);
28049  #endif
28050  }
28051  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28052  __pyx_t_float_complex z;
28053  float r, lnr, theta, z_r, z_theta;
28054  if (b.imag == 0 && b.real == (int)b.real) {
28055  if (b.real < 0) {
28056  float denom = a.real * a.real + a.imag * a.imag;
28057  a.real = a.real / denom;
28058  a.imag = -a.imag / denom;
28059  b.real = -b.real;
28060  }
28061  switch ((int)b.real) {
28062  case 0:
28063  z.real = 1;
28064  z.imag = 0;
28065  return z;
28066  case 1:
28067  return a;
28068  case 2:
28069  return __Pyx_c_prod_float(a, a);
28070  case 3:
28071  z = __Pyx_c_prod_float(a, a);
28072  return __Pyx_c_prod_float(z, a);
28073  case 4:
28074  z = __Pyx_c_prod_float(a, a);
28075  return __Pyx_c_prod_float(z, z);
28076  }
28077  }
28078  if (a.imag == 0) {
28079  if (a.real == 0) {
28080  return a;
28081  } else if (b.imag == 0) {
28082  z.real = powf(a.real, b.real);
28083  z.imag = 0;
28084  return z;
28085  } else if (a.real > 0) {
28086  r = a.real;
28087  theta = 0;
28088  } else {
28089  r = -a.real;
28090  theta = atan2f(0.0, -1.0);
28091  }
28092  } else {
28093  r = __Pyx_c_abs_float(a);
28094  theta = atan2f(a.imag, a.real);
28095  }
28096  lnr = logf(r);
28097  z_r = expf(lnr * b.real - theta * b.imag);
28098  z_theta = theta * b.real + lnr * b.imag;
28099  z.real = z_r * cosf(z_theta);
28100  z.imag = z_r * sinf(z_theta);
28101  return z;
28102  }
28103  #endif
28104 #endif
28105 
28106 /* Declarations */
28107  #if CYTHON_CCOMPLEX
28108  #ifdef __cplusplus
28109  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
28110  return ::std::complex< double >(x, y);
28111  }
28112  #else
28113  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
28114  return x + y*(__pyx_t_double_complex)_Complex_I;
28115  }
28116  #endif
28117 #else
28118  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
28119  __pyx_t_double_complex z;
28120  z.real = x;
28121  z.imag = y;
28122  return z;
28123  }
28124 #endif
28125 
28126 /* Arithmetic */
28127  #if CYTHON_CCOMPLEX
28128 #else
28129  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28130  return (a.real == b.real) && (a.imag == b.imag);
28131  }
28132  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28133  __pyx_t_double_complex z;
28134  z.real = a.real + b.real;
28135  z.imag = a.imag + b.imag;
28136  return z;
28137  }
28138  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28139  __pyx_t_double_complex z;
28140  z.real = a.real - b.real;
28141  z.imag = a.imag - b.imag;
28142  return z;
28143  }
28144  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28145  __pyx_t_double_complex z;
28146  z.real = a.real * b.real - a.imag * b.imag;
28147  z.imag = a.real * b.imag + a.imag * b.real;
28148  return z;
28149  }
28150  #if 1
28151  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28152  if (b.imag == 0) {
28153  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
28154  } else if (fabs(b.real) >= fabs(b.imag)) {
28155  if (b.real == 0 && b.imag == 0) {
28156  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
28157  } else {
28158  double r = b.imag / b.real;
28159  double s = (double)(1.0) / (b.real + b.imag * r);
28160  return __pyx_t_double_complex_from_parts(
28161  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
28162  }
28163  } else {
28164  double r = b.real / b.imag;
28165  double s = (double)(1.0) / (b.imag + b.real * r);
28166  return __pyx_t_double_complex_from_parts(
28167  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
28168  }
28169  }
28170  #else
28171  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28172  if (b.imag == 0) {
28173  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
28174  } else {
28175  double denom = b.real * b.real + b.imag * b.imag;
28176  return __pyx_t_double_complex_from_parts(
28177  (a.real * b.real + a.imag * b.imag) / denom,
28178  (a.imag * b.real - a.real * b.imag) / denom);
28179  }
28180  }
28181  #endif
28182  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
28183  __pyx_t_double_complex z;
28184  z.real = -a.real;
28185  z.imag = -a.imag;
28186  return z;
28187  }
28188  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
28189  return (a.real == 0) && (a.imag == 0);
28190  }
28191  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
28192  __pyx_t_double_complex z;
28193  z.real = a.real;
28194  z.imag = -a.imag;
28195  return z;
28196  }
28197  #if 1
28198  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
28199  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
28200  return sqrt(z.real*z.real + z.imag*z.imag);
28201  #else
28202  return hypot(z.real, z.imag);
28203  #endif
28204  }
28205  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28206  __pyx_t_double_complex z;
28207  double r, lnr, theta, z_r, z_theta;
28208  if (b.imag == 0 && b.real == (int)b.real) {
28209  if (b.real < 0) {
28210  double denom = a.real * a.real + a.imag * a.imag;
28211  a.real = a.real / denom;
28212  a.imag = -a.imag / denom;
28213  b.real = -b.real;
28214  }
28215  switch ((int)b.real) {
28216  case 0:
28217  z.real = 1;
28218  z.imag = 0;
28219  return z;
28220  case 1:
28221  return a;
28222  case 2:
28223  return __Pyx_c_prod_double(a, a);
28224  case 3:
28225  z = __Pyx_c_prod_double(a, a);
28226  return __Pyx_c_prod_double(z, a);
28227  case 4:
28228  z = __Pyx_c_prod_double(a, a);
28229  return __Pyx_c_prod_double(z, z);
28230  }
28231  }
28232  if (a.imag == 0) {
28233  if (a.real == 0) {
28234  return a;
28235  } else if (b.imag == 0) {
28236  z.real = pow(a.real, b.real);
28237  z.imag = 0;
28238  return z;
28239  } else if (a.real > 0) {
28240  r = a.real;
28241  theta = 0;
28242  } else {
28243  r = -a.real;
28244  theta = atan2(0.0, -1.0);
28245  }
28246  } else {
28247  r = __Pyx_c_abs_double(a);
28248  theta = atan2(a.imag, a.real);
28249  }
28250  lnr = log(r);
28251  z_r = exp(lnr * b.real - theta * b.imag);
28252  z_theta = theta * b.real + lnr * b.imag;
28253  z.real = z_r * cos(z_theta);
28254  z.imag = z_r * sin(z_theta);
28255  return z;
28256  }
28257  #endif
28258 #endif
28259 
28260 /* MemviewSliceCopyTemplate */
28261  static __Pyx_memviewslice
28262 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
28263  const char *mode, int ndim,
28264  size_t sizeof_dtype, int contig_flag,
28265  int dtype_is_object)
28266 {
28267  __Pyx_RefNannyDeclarations
28268  int i;
28269  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
28270  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
28271  Py_buffer *buf = &from_memview->view;
28272  PyObject *shape_tuple = NULL;
28273  PyObject *temp_int = NULL;
28274  struct __pyx_array_obj *array_obj = NULL;
28275  struct __pyx_memoryview_obj *memview_obj = NULL;
28276  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
28277  for (i = 0; i < ndim; i++) {
28278  if (unlikely(from_mvs->suboffsets[i] >= 0)) {
28279  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
28280  "indirect dimensions (axis %d)", i);
28281  goto fail;
28282  }
28283  }
28284  shape_tuple = PyTuple_New(ndim);
28285  if (unlikely(!shape_tuple)) {
28286  goto fail;
28287  }
28288  __Pyx_GOTREF(shape_tuple);
28289  for(i = 0; i < ndim; i++) {
28290  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
28291  if(unlikely(!temp_int)) {
28292  goto fail;
28293  } else {
28294  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
28295  temp_int = NULL;
28296  }
28297  }
28298  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
28299  if (unlikely(!array_obj)) {
28300  goto fail;
28301  }
28302  __Pyx_GOTREF(array_obj);
28303  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
28304  (PyObject *) array_obj, contig_flag,
28305  dtype_is_object,
28306  from_mvs->memview->typeinfo);
28307  if (unlikely(!memview_obj))
28308  goto fail;
28309  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
28310  goto fail;
28311  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
28312  dtype_is_object) < 0))
28313  goto fail;
28314  goto no_fail;
28315 fail:
28316  __Pyx_XDECREF(new_mvs.memview);
28317  new_mvs.memview = NULL;
28318  new_mvs.data = NULL;
28319 no_fail:
28320  __Pyx_XDECREF(shape_tuple);
28321  __Pyx_XDECREF(temp_int);
28322  __Pyx_XDECREF(array_obj);
28323  __Pyx_RefNannyFinishContext();
28324  return new_mvs;
28325 }
28326 
28327 /* CIntToPy */
28328  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
28329 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28330 #pragma GCC diagnostic push
28331 #pragma GCC diagnostic ignored "-Wconversion"
28332 #endif
28333  const int neg_one = (int) -1, const_zero = (int) 0;
28334 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28335 #pragma GCC diagnostic pop
28336 #endif
28337  const int is_unsigned = neg_one > const_zero;
28338  if (is_unsigned) {
28339  if (sizeof(int) < sizeof(long)) {
28340  return PyInt_FromLong((long) value);
28341  } else if (sizeof(int) <= sizeof(unsigned long)) {
28342  return PyLong_FromUnsignedLong((unsigned long) value);
28343 #ifdef HAVE_LONG_LONG
28344  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
28345  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28346 #endif
28347  }
28348  } else {
28349  if (sizeof(int) <= sizeof(long)) {
28350  return PyInt_FromLong((long) value);
28351 #ifdef HAVE_LONG_LONG
28352  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
28353  return PyLong_FromLongLong((PY_LONG_LONG) value);
28354 #endif
28355  }
28356  }
28357  {
28358  int one = 1; int little = (int)*(unsigned char *)&one;
28359  unsigned char *bytes = (unsigned char *)&value;
28360  return _PyLong_FromByteArray(bytes, sizeof(int),
28361  little, !is_unsigned);
28362  }
28363 }
28364 
28365 /* CIntFromPy */
28366  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
28367 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28368 #pragma GCC diagnostic push
28369 #pragma GCC diagnostic ignored "-Wconversion"
28370 #endif
28371  const int neg_one = (int) -1, const_zero = (int) 0;
28372 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28373 #pragma GCC diagnostic pop
28374 #endif
28375  const int is_unsigned = neg_one > const_zero;
28376 #if PY_MAJOR_VERSION < 3
28377  if (likely(PyInt_Check(x))) {
28378  if (sizeof(int) < sizeof(long)) {
28379  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
28380  } else {
28381  long val = PyInt_AS_LONG(x);
28382  if (is_unsigned && unlikely(val < 0)) {
28383  goto raise_neg_overflow;
28384  }
28385  return (int) val;
28386  }
28387  } else
28388 #endif
28389  if (likely(PyLong_Check(x))) {
28390  if (is_unsigned) {
28391 #if CYTHON_USE_PYLONG_INTERNALS
28392  const digit* digits = ((PyLongObject*)x)->ob_digit;
28393  switch (Py_SIZE(x)) {
28394  case 0: return (int) 0;
28395  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
28396  case 2:
28397  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
28398  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28399  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28400  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
28401  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28402  }
28403  }
28404  break;
28405  case 3:
28406  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
28407  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28408  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28409  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
28410  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28411  }
28412  }
28413  break;
28414  case 4:
28415  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
28416  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28417  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28418  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
28419  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28420  }
28421  }
28422  break;
28423  }
28424 #endif
28425 #if CYTHON_COMPILING_IN_CPYTHON
28426  if (unlikely(Py_SIZE(x) < 0)) {
28427  goto raise_neg_overflow;
28428  }
28429 #else
28430  {
28431  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28432  if (unlikely(result < 0))
28433  return (int) -1;
28434  if (unlikely(result == 1))
28435  goto raise_neg_overflow;
28436  }
28437 #endif
28438  if (sizeof(int) <= sizeof(unsigned long)) {
28439  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
28440 #ifdef HAVE_LONG_LONG
28441  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
28442  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28443 #endif
28444  }
28445  } else {
28446 #if CYTHON_USE_PYLONG_INTERNALS
28447  const digit* digits = ((PyLongObject*)x)->ob_digit;
28448  switch (Py_SIZE(x)) {
28449  case 0: return (int) 0;
28450  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
28451  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
28452  case -2:
28453  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
28454  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28455  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28456  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
28457  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28458  }
28459  }
28460  break;
28461  case 2:
28462  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
28463  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28464  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28465  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
28466  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28467  }
28468  }
28469  break;
28470  case -3:
28471  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
28472  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28473  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28474  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28475  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28476  }
28477  }
28478  break;
28479  case 3:
28480  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
28481  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28482  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28483  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28484  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28485  }
28486  }
28487  break;
28488  case -4:
28489  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28490  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28491  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28492  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
28493  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28494  }
28495  }
28496  break;
28497  case 4:
28498  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
28499  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28500  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28501  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
28502  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28503  }
28504  }
28505  break;
28506  }
28507 #endif
28508  if (sizeof(int) <= sizeof(long)) {
28509  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
28510 #ifdef HAVE_LONG_LONG
28511  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
28512  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
28513 #endif
28514  }
28515  }
28516  {
28517 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28518  PyErr_SetString(PyExc_RuntimeError,
28519  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28520 #else
28521  int val;
28522  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28523  #if PY_MAJOR_VERSION < 3
28524  if (likely(v) && !PyLong_Check(v)) {
28525  PyObject *tmp = v;
28526  v = PyNumber_Long(tmp);
28527  Py_DECREF(tmp);
28528  }
28529  #endif
28530  if (likely(v)) {
28531  int one = 1; int is_little = (int)*(unsigned char *)&one;
28532  unsigned char *bytes = (unsigned char *)&val;
28533  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28534  bytes, sizeof(val),
28535  is_little, !is_unsigned);
28536  Py_DECREF(v);
28537  if (likely(!ret))
28538  return val;
28539  }
28540 #endif
28541  return (int) -1;
28542  }
28543  } else {
28544  int val;
28545  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28546  if (!tmp) return (int) -1;
28547  val = __Pyx_PyInt_As_int(tmp);
28548  Py_DECREF(tmp);
28549  return val;
28550  }
28551 raise_overflow:
28552  PyErr_SetString(PyExc_OverflowError,
28553  "value too large to convert to int");
28554  return (int) -1;
28555 raise_neg_overflow:
28556  PyErr_SetString(PyExc_OverflowError,
28557  "can't convert negative value to int");
28558  return (int) -1;
28559 }
28560 
28561 /* CIntFromPy */
28562  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
28563 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28564 #pragma GCC diagnostic push
28565 #pragma GCC diagnostic ignored "-Wconversion"
28566 #endif
28567  const long neg_one = (long) -1, const_zero = (long) 0;
28568 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28569 #pragma GCC diagnostic pop
28570 #endif
28571  const int is_unsigned = neg_one > const_zero;
28572 #if PY_MAJOR_VERSION < 3
28573  if (likely(PyInt_Check(x))) {
28574  if (sizeof(long) < sizeof(long)) {
28575  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
28576  } else {
28577  long val = PyInt_AS_LONG(x);
28578  if (is_unsigned && unlikely(val < 0)) {
28579  goto raise_neg_overflow;
28580  }
28581  return (long) val;
28582  }
28583  } else
28584 #endif
28585  if (likely(PyLong_Check(x))) {
28586  if (is_unsigned) {
28587 #if CYTHON_USE_PYLONG_INTERNALS
28588  const digit* digits = ((PyLongObject*)x)->ob_digit;
28589  switch (Py_SIZE(x)) {
28590  case 0: return (long) 0;
28591  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
28592  case 2:
28593  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28594  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28595  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28596  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
28597  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28598  }
28599  }
28600  break;
28601  case 3:
28602  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28603  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28604  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28605  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
28606  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28607  }
28608  }
28609  break;
28610  case 4:
28611  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28612  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28613  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28614  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
28615  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28616  }
28617  }
28618  break;
28619  }
28620 #endif
28621 #if CYTHON_COMPILING_IN_CPYTHON
28622  if (unlikely(Py_SIZE(x) < 0)) {
28623  goto raise_neg_overflow;
28624  }
28625 #else
28626  {
28627  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28628  if (unlikely(result < 0))
28629  return (long) -1;
28630  if (unlikely(result == 1))
28631  goto raise_neg_overflow;
28632  }
28633 #endif
28634  if (sizeof(long) <= sizeof(unsigned long)) {
28635  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
28636 #ifdef HAVE_LONG_LONG
28637  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28638  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28639 #endif
28640  }
28641  } else {
28642 #if CYTHON_USE_PYLONG_INTERNALS
28643  const digit* digits = ((PyLongObject*)x)->ob_digit;
28644  switch (Py_SIZE(x)) {
28645  case 0: return (long) 0;
28646  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
28647  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
28648  case -2:
28649  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
28650  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28651  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28652  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28653  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28654  }
28655  }
28656  break;
28657  case 2:
28658  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28659  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28660  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28661  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28662  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28663  }
28664  }
28665  break;
28666  case -3:
28667  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28668  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28669  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28670  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28671  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28672  }
28673  }
28674  break;
28675  case 3:
28676  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28677  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28678  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28679  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28680  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28681  }
28682  }
28683  break;
28684  case -4:
28685  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28686  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28687  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28688  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28689  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28690  }
28691  }
28692  break;
28693  case 4:
28694  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28695  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28696  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28697  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28698  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28699  }
28700  }
28701  break;
28702  }
28703 #endif
28704  if (sizeof(long) <= sizeof(long)) {
28705  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
28706 #ifdef HAVE_LONG_LONG
28707  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28708  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
28709 #endif
28710  }
28711  }
28712  {
28713 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28714  PyErr_SetString(PyExc_RuntimeError,
28715  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28716 #else
28717  long val;
28718  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28719  #if PY_MAJOR_VERSION < 3
28720  if (likely(v) && !PyLong_Check(v)) {
28721  PyObject *tmp = v;
28722  v = PyNumber_Long(tmp);
28723  Py_DECREF(tmp);
28724  }
28725  #endif
28726  if (likely(v)) {
28727  int one = 1; int is_little = (int)*(unsigned char *)&one;
28728  unsigned char *bytes = (unsigned char *)&val;
28729  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28730  bytes, sizeof(val),
28731  is_little, !is_unsigned);
28732  Py_DECREF(v);
28733  if (likely(!ret))
28734  return val;
28735  }
28736 #endif
28737  return (long) -1;
28738  }
28739  } else {
28740  long val;
28741  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28742  if (!tmp) return (long) -1;
28743  val = __Pyx_PyInt_As_long(tmp);
28744  Py_DECREF(tmp);
28745  return val;
28746  }
28747 raise_overflow:
28748  PyErr_SetString(PyExc_OverflowError,
28749  "value too large to convert to long");
28750  return (long) -1;
28751 raise_neg_overflow:
28752  PyErr_SetString(PyExc_OverflowError,
28753  "can't convert negative value to long");
28754  return (long) -1;
28755 }
28756 
28757 /* CIntToPy */
28758  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
28759 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28760 #pragma GCC diagnostic push
28761 #pragma GCC diagnostic ignored "-Wconversion"
28762 #endif
28763  const long neg_one = (long) -1, const_zero = (long) 0;
28764 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28765 #pragma GCC diagnostic pop
28766 #endif
28767  const int is_unsigned = neg_one > const_zero;
28768  if (is_unsigned) {
28769  if (sizeof(long) < sizeof(long)) {
28770  return PyInt_FromLong((long) value);
28771  } else if (sizeof(long) <= sizeof(unsigned long)) {
28772  return PyLong_FromUnsignedLong((unsigned long) value);
28773 #ifdef HAVE_LONG_LONG
28774  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28775  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28776 #endif
28777  }
28778  } else {
28779  if (sizeof(long) <= sizeof(long)) {
28780  return PyInt_FromLong((long) value);
28781 #ifdef HAVE_LONG_LONG
28782  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28783  return PyLong_FromLongLong((PY_LONG_LONG) value);
28784 #endif
28785  }
28786  }
28787  {
28788  int one = 1; int little = (int)*(unsigned char *)&one;
28789  unsigned char *bytes = (unsigned char *)&value;
28790  return _PyLong_FromByteArray(bytes, sizeof(long),
28791  little, !is_unsigned);
28792  }
28793 }
28794 
28795 /* CIntFromPy */
28796  static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
28797 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28798 #pragma GCC diagnostic push
28799 #pragma GCC diagnostic ignored "-Wconversion"
28800 #endif
28801  const char neg_one = (char) -1, const_zero = (char) 0;
28802 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28803 #pragma GCC diagnostic pop
28804 #endif
28805  const int is_unsigned = neg_one > const_zero;
28806 #if PY_MAJOR_VERSION < 3
28807  if (likely(PyInt_Check(x))) {
28808  if (sizeof(char) < sizeof(long)) {
28809  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
28810  } else {
28811  long val = PyInt_AS_LONG(x);
28812  if (is_unsigned && unlikely(val < 0)) {
28813  goto raise_neg_overflow;
28814  }
28815  return (char) val;
28816  }
28817  } else
28818 #endif
28819  if (likely(PyLong_Check(x))) {
28820  if (is_unsigned) {
28821 #if CYTHON_USE_PYLONG_INTERNALS
28822  const digit* digits = ((PyLongObject*)x)->ob_digit;
28823  switch (Py_SIZE(x)) {
28824  case 0: return (char) 0;
28825  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
28826  case 2:
28827  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28828  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28829  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28830  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
28831  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28832  }
28833  }
28834  break;
28835  case 3:
28836  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28837  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28838  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28839  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
28840  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28841  }
28842  }
28843  break;
28844  case 4:
28845  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28846  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28847  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28848  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
28849  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28850  }
28851  }
28852  break;
28853  }
28854 #endif
28855 #if CYTHON_COMPILING_IN_CPYTHON
28856  if (unlikely(Py_SIZE(x) < 0)) {
28857  goto raise_neg_overflow;
28858  }
28859 #else
28860  {
28861  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28862  if (unlikely(result < 0))
28863  return (char) -1;
28864  if (unlikely(result == 1))
28865  goto raise_neg_overflow;
28866  }
28867 #endif
28868  if (sizeof(char) <= sizeof(unsigned long)) {
28869  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
28870 #ifdef HAVE_LONG_LONG
28871  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
28872  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28873 #endif
28874  }
28875  } else {
28876 #if CYTHON_USE_PYLONG_INTERNALS
28877  const digit* digits = ((PyLongObject*)x)->ob_digit;
28878  switch (Py_SIZE(x)) {
28879  case 0: return (char) 0;
28880  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
28881  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
28882  case -2:
28883  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
28884  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28885  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28886  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28887  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28888  }
28889  }
28890  break;
28891  case 2:
28892  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28893  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28894  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28895  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28896  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28897  }
28898  }
28899  break;
28900  case -3:
28901  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28902  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28903  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28904  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28905  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28906  }
28907  }
28908  break;
28909  case 3:
28910  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28911  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28912  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28913  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28914  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28915  }
28916  }
28917  break;
28918  case -4:
28919  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28920  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28921  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28922  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28923  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28924  }
28925  }
28926  break;
28927  case 4:
28928  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28929  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28930  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28931  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28932  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28933  }
28934  }
28935  break;
28936  }
28937 #endif
28938  if (sizeof(char) <= sizeof(long)) {
28939  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
28940 #ifdef HAVE_LONG_LONG
28941  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
28942  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
28943 #endif
28944  }
28945  }
28946  {
28947 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28948  PyErr_SetString(PyExc_RuntimeError,
28949  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28950 #else
28951  char val;
28952  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28953  #if PY_MAJOR_VERSION < 3
28954  if (likely(v) && !PyLong_Check(v)) {
28955  PyObject *tmp = v;
28956  v = PyNumber_Long(tmp);
28957  Py_DECREF(tmp);
28958  }
28959  #endif
28960  if (likely(v)) {
28961  int one = 1; int is_little = (int)*(unsigned char *)&one;
28962  unsigned char *bytes = (unsigned char *)&val;
28963  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28964  bytes, sizeof(val),
28965  is_little, !is_unsigned);
28966  Py_DECREF(v);
28967  if (likely(!ret))
28968  return val;
28969  }
28970 #endif
28971  return (char) -1;
28972  }
28973  } else {
28974  char val;
28975  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28976  if (!tmp) return (char) -1;
28977  val = __Pyx_PyInt_As_char(tmp);
28978  Py_DECREF(tmp);
28979  return val;
28980  }
28981 raise_overflow:
28982  PyErr_SetString(PyExc_OverflowError,
28983  "value too large to convert to char");
28984  return (char) -1;
28985 raise_neg_overflow:
28986  PyErr_SetString(PyExc_OverflowError,
28987  "can't convert negative value to char");
28988  return (char) -1;
28989 }
28990 
28991 /* CheckBinaryVersion */
28992  static int __Pyx_check_binary_version(void) {
28993  char ctversion[4], rtversion[4];
28994  PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
28995  PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
28996  if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
28997  char message[200];
28998  PyOS_snprintf(message, sizeof(message),
28999  "compiletime version %s of module '%.100s' "
29000  "does not match runtime version %s",
29001  ctversion, __Pyx_MODULE_NAME, rtversion);
29002  return PyErr_WarnEx(NULL, message, 1);
29003  }
29004  return 0;
29005 }
29006 
29007 /* InitStrings */
29008  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
29009  while (t->p) {
29010  #if PY_MAJOR_VERSION < 3
29011  if (t->is_unicode) {
29012  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
29013  } else if (t->intern) {
29014  *t->p = PyString_InternFromString(t->s);
29015  } else {
29016  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
29017  }
29018  #else
29019  if (t->is_unicode | t->is_str) {
29020  if (t->intern) {
29021  *t->p = PyUnicode_InternFromString(t->s);
29022  } else if (t->encoding) {
29023  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
29024  } else {
29025  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
29026  }
29027  } else {
29028  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
29029  }
29030  #endif
29031  if (!*t->p)
29032  return -1;
29033  if (PyObject_Hash(*t->p) == -1)
29034  return -1;
29035  ++t;
29036  }
29037  return 0;
29038 }
29039 
29040 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
29041  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
29042 }
29043 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
29044  Py_ssize_t ignore;
29045  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
29046 }
29047 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29048 #if !CYTHON_PEP393_ENABLED
29049 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29050  char* defenc_c;
29051  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
29052  if (!defenc) return NULL;
29053  defenc_c = PyBytes_AS_STRING(defenc);
29054 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29055  {
29056  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
29057  char* c;
29058  for (c = defenc_c; c < end; c++) {
29059  if ((unsigned char) (*c) >= 128) {
29060  PyUnicode_AsASCIIString(o);
29061  return NULL;
29062  }
29063  }
29064  }
29065 #endif
29066  *length = PyBytes_GET_SIZE(defenc);
29067  return defenc_c;
29068 }
29069 #else
29070 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29071  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
29072 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29073  if (likely(PyUnicode_IS_ASCII(o))) {
29074  *length = PyUnicode_GET_LENGTH(o);
29075  return PyUnicode_AsUTF8(o);
29076  } else {
29077  PyUnicode_AsASCIIString(o);
29078  return NULL;
29079  }
29080 #else
29081  return PyUnicode_AsUTF8AndSize(o, length);
29082 #endif
29083 }
29084 #endif
29085 #endif
29086 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29087 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29088  if (
29089 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29090  __Pyx_sys_getdefaultencoding_not_ascii &&
29091 #endif
29092  PyUnicode_Check(o)) {
29093  return __Pyx_PyUnicode_AsStringAndSize(o, length);
29094  } else
29095 #endif
29096 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
29097  if (PyByteArray_Check(o)) {
29098  *length = PyByteArray_GET_SIZE(o);
29099  return PyByteArray_AS_STRING(o);
29100  } else
29101 #endif
29102  {
29103  char* result;
29104  int r = PyBytes_AsStringAndSize(o, &result, length);
29105  if (unlikely(r < 0)) {
29106  return NULL;
29107  } else {
29108  return result;
29109  }
29110  }
29111 }
29112 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
29113  int is_true = x == Py_True;
29114  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
29115  else return PyObject_IsTrue(x);
29116 }
29117 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
29118  int retval;
29119  if (unlikely(!x)) return -1;
29120  retval = __Pyx_PyObject_IsTrue(x);
29121  Py_DECREF(x);
29122  return retval;
29123 }
29124 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
29125 #if PY_MAJOR_VERSION >= 3
29126  if (PyLong_Check(result)) {
29127  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
29128  "__int__ returned non-int (type %.200s). "
29129  "The ability to return an instance of a strict subclass of int "
29130  "is deprecated, and may be removed in a future version of Python.",
29131  Py_TYPE(result)->tp_name)) {
29132  Py_DECREF(result);
29133  return NULL;
29134  }
29135  return result;
29136  }
29137 #endif
29138  PyErr_Format(PyExc_TypeError,
29139  "__%.4s__ returned non-%.4s (type %.200s)",
29140  type_name, type_name, Py_TYPE(result)->tp_name);
29141  Py_DECREF(result);
29142  return NULL;
29143 }
29144 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
29145 #if CYTHON_USE_TYPE_SLOTS
29146  PyNumberMethods *m;
29147 #endif
29148  const char *name = NULL;
29149  PyObject *res = NULL;
29150 #if PY_MAJOR_VERSION < 3
29151  if (likely(PyInt_Check(x) || PyLong_Check(x)))
29152 #else
29153  if (likely(PyLong_Check(x)))
29154 #endif
29155  return __Pyx_NewRef(x);
29156 #if CYTHON_USE_TYPE_SLOTS
29157  m = Py_TYPE(x)->tp_as_number;
29158  #if PY_MAJOR_VERSION < 3
29159  if (m && m->nb_int) {
29160  name = "int";
29161  res = m->nb_int(x);
29162  }
29163  else if (m && m->nb_long) {
29164  name = "long";
29165  res = m->nb_long(x);
29166  }
29167  #else
29168  if (likely(m && m->nb_int)) {
29169  name = "int";
29170  res = m->nb_int(x);
29171  }
29172  #endif
29173 #else
29174  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
29175  res = PyNumber_Int(x);
29176  }
29177 #endif
29178  if (likely(res)) {
29179 #if PY_MAJOR_VERSION < 3
29180  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
29181 #else
29182  if (unlikely(!PyLong_CheckExact(res))) {
29183 #endif
29184  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
29185  }
29186  }
29187  else if (!PyErr_Occurred()) {
29188  PyErr_SetString(PyExc_TypeError,
29189  "an integer is required");
29190  }
29191  return res;
29192 }
29193 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
29194  Py_ssize_t ival;
29195  PyObject *x;
29196 #if PY_MAJOR_VERSION < 3
29197  if (likely(PyInt_CheckExact(b))) {
29198  if (sizeof(Py_ssize_t) >= sizeof(long))
29199  return PyInt_AS_LONG(b);
29200  else
29201  return PyInt_AsSsize_t(b);
29202  }
29203 #endif
29204  if (likely(PyLong_CheckExact(b))) {
29205  #if CYTHON_USE_PYLONG_INTERNALS
29206  const digit* digits = ((PyLongObject*)b)->ob_digit;
29207  const Py_ssize_t size = Py_SIZE(b);
29208  if (likely(__Pyx_sst_abs(size) <= 1)) {
29209  ival = likely(size) ? digits[0] : 0;
29210  if (size == -1) ival = -ival;
29211  return ival;
29212  } else {
29213  switch (size) {
29214  case 2:
29215  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29216  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29217  }
29218  break;
29219  case -2:
29220  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29221  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29222  }
29223  break;
29224  case 3:
29225  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29226  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29227  }
29228  break;
29229  case -3:
29230  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29231  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29232  }
29233  break;
29234  case 4:
29235  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29236  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29237  }
29238  break;
29239  case -4:
29240  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29241  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29242  }
29243  break;
29244  }
29245  }
29246  #endif
29247  return PyLong_AsSsize_t(b);
29248  }
29249  x = PyNumber_Index(b);
29250  if (!x) return -1;
29251  ival = PyInt_AsSsize_t(x);
29252  Py_DECREF(x);
29253  return ival;
29254 }
29255 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
29256  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
29257 }
29258 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
29259  return PyInt_FromSize_t(ival);
29260 }
29261 
29262 
29263 #endif /* Py_PYTHON_H */
f
Double f
Definition: Headers.h:64
number
Int number
Definition: Headers.h:33
s
Double s
Definition: Headers.h:84
L
Double L
Definition: Headers.h:72
n
Int n
Definition: Headers.h:28
q
Double q
Definition: Headers.h:81
U
Double U
Definition: Headers.h:88
v
Double v
Definition: Headers.h:95
T
Double T
Definition: Headers.h:87
z
Double * z
Definition: Headers.h:49
u
Double u
Definition: Headers.h:89
c
Double c
Definition: Headers.h:54
r
Double r
Definition: Headers.h:83
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8